//-----------------------------------------------------------------------------
// Microsoft OLE DB RowsetViewer
// Copyright (C) 1994 - 1999 By Microsoft Corporation.
//
// @doc
//
// @module ERROR.CPP
//
//-----------------------------------------------------------------------------------

////////////////////////////////////////////////////////////////////////
// Includes
//
////////////////////////////////////////////////////////////////////////
#include "Headers.h"


////////////////////////////////////////////////////////////////////////
// Globals
//
////////////////////////////////////////////////////////////////////////
DWORD g_dwErrorPost = EP_ERRORINFO_FAILURE | EP_HRESULT_NOERRORINFO;
DWORD g_dwBreakID	= 0;

BOOL SetErrorPosting(ERRORPOST eErrorPost, BOOL fSet)
{ 
	if(fSet)
		g_dwErrorPost |= eErrorPost;
	else
		g_dwErrorPost &= ~eErrorPost;

	return TRUE;
};

BOOL GetErrorPosting(ERRORPOST eErrorPost) 
{ 
	return g_dwErrorPost & eErrorPost;
};


	
/////////////////////////////////////////////////////////////////////////////
// 	Interface Map
//
/////////////////////////////////////////////////////////////////////////////
const static WIDEGUIDMAP g_rgInterfaceMaps[] =
{
	//TEnumerator
		VALUE_PWCHAR(IID_IParseDisplayName),		
		VALUE_PWCHAR(IID_ISourcesRowset),

	//TDataSource
		VALUE_PWCHAR(IID_IDBInitialize),			
		VALUE_PWCHAR(IID_IDBProperties),
		VALUE_PWCHAR(IID_IDBCreateSession),
		VALUE_PWCHAR(IID_IDBInfo),
		VALUE_PWCHAR(IID_IPersist),
		VALUE_PWCHAR(IID_IDBAsynchStatus),
		VALUE_PWCHAR(IID_IDBDataSourceAdmin),
		VALUE_PWCHAR(IID_IPersistFile),
		VALUE_PWCHAR(IID_ISupportErrorInfo),
		VALUE_PWCHAR(IID_IServiceProvider),
		VALUE_PWCHAR(IID_ISpecifyPropertyPages),

	//TSession
		VALUE_PWCHAR(IID_IGetDataSource),			
		VALUE_PWCHAR(IID_IOpenRowset),
		VALUE_PWCHAR(IID_ISessionProperties),
		VALUE_PWCHAR(IID_IDBCreateCommand),
		VALUE_PWCHAR(IID_IDBSchemaRowset),
		VALUE_PWCHAR(IID_IIndexDefinition),
		VALUE_PWCHAR(IID_IAlterIndex),
		VALUE_PWCHAR(IID_IAlterTable),
		VALUE_PWCHAR(IID_ITableDefinition),
		VALUE_PWCHAR(IID_ITransactionJoin),
		VALUE_PWCHAR(IID_ITransactionLocal),
		VALUE_PWCHAR(IID_ITransactionObject),

	//TCommand
		VALUE_PWCHAR(IID_IAccessor),				
		VALUE_PWCHAR(IID_IColumnsInfo),
		VALUE_PWCHAR(IID_ICommand),
		VALUE_PWCHAR(IID_ICommandProperties),
		VALUE_PWCHAR(IID_ICommandText),
		VALUE_PWCHAR(IID_IConvertType),
		VALUE_PWCHAR(IID_IColumnsRowset),
		VALUE_PWCHAR(IID_ICommandPrepare),
		VALUE_PWCHAR(IID_ICommandPersist),
		VALUE_PWCHAR(IID_ICommandStream),
		VALUE_PWCHAR(IID_ICommandWithParameters),
	
	//TRowset
		VALUE_PWCHAR(IID_IRowset),					
		VALUE_PWCHAR(IID_IRowsetInfo),
		VALUE_PWCHAR(IID_IConnectionPointContainer),
		VALUE_PWCHAR(IID_IRowsetChange),
		VALUE_PWCHAR(IID_IRowsetIdentity),
		VALUE_PWCHAR(IID_IRowsetLocate),
		VALUE_PWCHAR(IID_IRowsetFind),
		VALUE_PWCHAR(IID_IRowsetView),
		VALUE_PWCHAR(IID_IChapteredRowset),
		VALUE_PWCHAR(IID_IRowsetResynch),
		VALUE_PWCHAR(IID_IRowsetRefresh),
		VALUE_PWCHAR(IID_IRowsetScroll),
		VALUE_PWCHAR(IID_IRowsetUpdate),
		VALUE_PWCHAR(IID_IRowsetBookmark),
		VALUE_PWCHAR(IID_IParentRowset),
		VALUE_PWCHAR(IID_IGetRow),

	//TRow
		VALUE_PWCHAR(IID_IRow),						
		VALUE_PWCHAR(IID_IGetSession),
		VALUE_PWCHAR(IID_IColumnsInfo2),
		VALUE_PWCHAR(IID_IRowChange),
		VALUE_PWCHAR(IID_IRowSchemaChange),
		VALUE_PWCHAR(IID_ICreateRow),
		VALUE_PWCHAR(IID_IScopedOperations),

	//TTransaction
		VALUE_PWCHAR(IID_ITransaction),
		VALUE_PWCHAR(IID_ITransactionOptions),

	//TMultipleResults
		VALUE_PWCHAR(IID_IMultipleResults),

	//TView
		VALUE_PWCHAR(IID_IViewChapter),
		VALUE_PWCHAR(IID_IViewFilter),
		VALUE_PWCHAR(IID_IViewRowset),
		VALUE_PWCHAR(IID_IViewSort),

	//TIndex
		VALUE_PWCHAR(IID_IRowsetIndex),
	
	//TError
		VALUE_PWCHAR(IID_IErrorInfo),
		VALUE_PWCHAR(IID_IErrorRecords),
		VALUE_PWCHAR(IID_ISQLErrorInfo),

	//Connection Points
		VALUE_PWCHAR(IID_IConnectionPoint),
		VALUE_PWCHAR(IID_IRowsetNotify),
		VALUE_PWCHAR(IID_IDBAsynchNotify),
		VALUE_PWCHAR(IID_IRowPositionChange),

	//Misc
		VALUE_PWCHAR(IID_IRowPosition),
		VALUE_PWCHAR(IID_ISequentialStream),
		VALUE_PWCHAR(IID_IStream),
		VALUE_PWCHAR(IID_IStorage),
		VALUE_PWCHAR(IID_ILockBytes),

	//MD
		VALUE_PWCHAR(IID_IMDDataset),
		VALUE_PWCHAR(IID_IMDFind),
		VALUE_PWCHAR(IID_IMDRangeRowset),

	//Security
		VALUE_PWCHAR(IID_ITrusteeAdmin),
		VALUE_PWCHAR(IID_ITrusteeGroupAdmin),
		VALUE_PWCHAR(IID_IObjectAccessControl),
		VALUE_PWCHAR(IID_ISecurityInfo),

	//Table Creation 
		VALUE_PWCHAR(IID_ITableDefinitionWithConstraints),
		VALUE_PWCHAR(IID_ITableCreation),

	//TBinder
		VALUE_PWCHAR(IID_IBindResource),
		VALUE_PWCHAR(IID_IDBBinderProperties),
		VALUE_PWCHAR(IID_IRegisterProvider),
		  
	//TStream
		VALUE_PWCHAR(IID_IGetSourceRow),

	//Service Components
		VALUE_PWCHAR(IID_IDBPromptInitialize),
		VALUE_PWCHAR(IID_IDataInitialize),


	//Aggregation
		VALUE_PWCHAR(IID_IAggregate),

	//IUnknown
		VALUE_PWCHAR(IID_IUnknown),
		VALUE_PWCHAR(IID_NULL),
};
const static ULONG g_cInterfaceMaps = NUMELE(g_rgInterfaceMaps);


////////////////////////////////////////////////////////////////////////
// rgDBTypes
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgDBTypes[] = 
{
    VALUE_WCHAR(DBTYPE_EMPTY	),
	VALUE_WCHAR(DBTYPE_NULL	),
	VALUE_WCHAR(DBTYPE_I2	),
	VALUE_WCHAR(DBTYPE_I4	),
	VALUE_WCHAR(DBTYPE_R4	),
	VALUE_WCHAR(DBTYPE_R8	),
	VALUE_WCHAR(DBTYPE_CY	),
	VALUE_WCHAR(DBTYPE_DATE	),
	VALUE_WCHAR(DBTYPE_BSTR	),
	VALUE_WCHAR(DBTYPE_IDISPATCH	),
	VALUE_WCHAR(DBTYPE_ERROR	),
	VALUE_WCHAR(DBTYPE_BOOL	),
	VALUE_WCHAR(DBTYPE_VARIANT	),
	VALUE_WCHAR(DBTYPE_IUNKNOWN	),
	VALUE_WCHAR(DBTYPE_DECIMAL	),
	VALUE_WCHAR(DBTYPE_UI1	),
	VALUE_WCHAR(DBTYPE_ARRAY	),
	VALUE_WCHAR(DBTYPE_BYREF	),
	VALUE_WCHAR(DBTYPE_I1	),
	VALUE_WCHAR(DBTYPE_UI2	),
	VALUE_WCHAR(DBTYPE_UI4	),
	VALUE_WCHAR(DBTYPE_I8	),
	VALUE_WCHAR(DBTYPE_UI8	),
	VALUE_WCHAR(DBTYPE_GUID	),
	VALUE_WCHAR(DBTYPE_VECTOR	),
	VALUE_WCHAR(DBTYPE_RESERVED	),
	VALUE_WCHAR(DBTYPE_BYTES	),
	VALUE_WCHAR(DBTYPE_STR	),
	VALUE_WCHAR(DBTYPE_WSTR	),
	VALUE_WCHAR(DBTYPE_NUMERIC	),
	VALUE_WCHAR(DBTYPE_UDT	),
	VALUE_WCHAR(DBTYPE_DBDATE	),
	VALUE_WCHAR(DBTYPE_DBTIME	),
	VALUE_WCHAR(DBTYPE_DBTIMESTAMP	),
	VALUE_WCHAR(DBTYPE_HCHAPTER	),

	//2.0 Types
	VALUE_WCHAR(DBTYPE_FILETIME	),
	VALUE_WCHAR(DBTYPE_PROPVARIANT	),
	VALUE_WCHAR(DBTYPE_VARNUMERIC	),
};
const static ULONG g_cDBTypes = NUMELE(g_rgDBTypes);


////////////////////////////////////////////////////////////////////////
// rgVariantTypes
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgVariantTypes[] = 
{
    VALUE_WCHAR(VT_EMPTY	),
	VALUE_WCHAR(VT_NULL	),
	VALUE_WCHAR(VT_I2	),
	VALUE_WCHAR(VT_I4	),
	VALUE_WCHAR(VT_R4	),
	VALUE_WCHAR(VT_R8	),
	VALUE_WCHAR(VT_CY	),
	VALUE_WCHAR(VT_DATE	),
	VALUE_WCHAR(VT_BSTR	),
	VALUE_WCHAR(VT_DISPATCH	),
	VALUE_WCHAR(VT_ERROR	),
	VALUE_WCHAR(VT_BOOL	),
	VALUE_WCHAR(VT_VARIANT	),
	VALUE_WCHAR(VT_UNKNOWN	),
	VALUE_WCHAR(VT_DECIMAL	),
	VALUE_WCHAR(VT_I1	),
	VALUE_WCHAR(VT_UI1	),
	VALUE_WCHAR(VT_UI2	),
	VALUE_WCHAR(VT_UI4	),
	VALUE_WCHAR(VT_I8	),
	VALUE_WCHAR(VT_UI8	),
	VALUE_WCHAR(VT_INT	),
	VALUE_WCHAR(VT_UINT	),
	VALUE_WCHAR(VT_VOID	),
	VALUE_WCHAR(VT_HRESULT	),
	VALUE_WCHAR(VT_PTR	),
	VALUE_WCHAR(VT_SAFEARRAY	),
	VALUE_WCHAR(VT_CARRAY	),
	VALUE_WCHAR(VT_USERDEFINED	),
	VALUE_WCHAR(VT_LPSTR	),
	VALUE_WCHAR(VT_LPWSTR	),
	VALUE_WCHAR(VT_FILETIME	),
	VALUE_WCHAR(VT_BLOB	),
	VALUE_WCHAR(VT_STREAM	),
	VALUE_WCHAR(VT_STORAGE	),
	VALUE_WCHAR(VT_STREAMED_OBJECT	),
	VALUE_WCHAR(VT_STORED_OBJECT	),
	VALUE_WCHAR(VT_BLOB_OBJECT	),
	VALUE_WCHAR(VT_CF	),
	VALUE_WCHAR(VT_CLSID	),
	VALUE_WCHAR(VT_VECTOR	),
	VALUE_WCHAR(VT_ARRAY	),
	VALUE_WCHAR(VT_BYREF	),
	VALUE_WCHAR(VT_RESERVED	),
	VALUE_WCHAR(VT_ILLEGAL	),
	VALUE_WCHAR(VT_ILLEGALMASKED	),
	VALUE_WCHAR(VT_TYPEMASK	),
};
const static ULONG g_cVariantTypes = NUMELE(g_rgVariantTypes);


////////////////////////////////////////////////////////////////////////
// ERRORMAP
//
////////////////////////////////////////////////////////////////////////
const static NAMEMAP g_rgErrorMap[] =
{
	 //System Success
	 VALUE_CHAR(S_OK),
	 VALUE_CHAR(S_FALSE),
	 VALUE_CHAR(CO_S_NOTALLINTERFACES),

	 //System Errors
	 VALUE_CHAR(E_FAIL),
	 VALUE_CHAR(E_INVALIDARG),
	 VALUE_CHAR(E_OUTOFMEMORY),
	 VALUE_CHAR(E_NOINTERFACE),
	 VALUE_CHAR(REGDB_E_CLASSNOTREG),
	 VALUE_CHAR(CLASS_E_NOAGGREGATION),
     VALUE_CHAR(E_UNEXPECTED),
     VALUE_CHAR(E_NOTIMPL),
     VALUE_CHAR(E_POINTER),
     VALUE_CHAR(E_HANDLE),
     VALUE_CHAR(E_ABORT),
     VALUE_CHAR(E_ACCESSDENIED),
     VALUE_CHAR(E_PENDING),

	 //OLE DB Warnings 1.1
     VALUE_CHAR(DB_S_ROWLIMITEXCEEDED),
     VALUE_CHAR(DB_S_COLUMNTYPEMISMATCH),
     VALUE_CHAR(DB_S_TYPEINFOOVERRIDDEN),
     VALUE_CHAR(DB_S_BOOKMARKSKIPPED),
     VALUE_CHAR(DB_S_ENDOFROWSET),
     VALUE_CHAR(DB_S_COMMANDREEXECUTED),
     VALUE_CHAR(DB_S_BUFFERFULL),
     VALUE_CHAR(DB_S_NORESULT),
     VALUE_CHAR(DB_S_CANTRELEASE),
     VALUE_CHAR(DB_S_DIALECTIGNORED),
     VALUE_CHAR(DB_S_UNWANTEDPHASE),
     VALUE_CHAR(DB_S_UNWANTEDREASON),
     VALUE_CHAR(DB_S_COLUMNSCHANGED),
     VALUE_CHAR(DB_S_ERRORSRETURNED),
     VALUE_CHAR(DB_S_BADROWHANDLE),
     VALUE_CHAR(DB_S_DELETEDROW),
     VALUE_CHAR(DB_S_STOPLIMITREACHED),
     VALUE_CHAR(DB_S_LOCKUPGRADED),
     VALUE_CHAR(DB_S_PROPERTIESCHANGED),
     VALUE_CHAR(DB_S_ERRORSOCCURRED),
     VALUE_CHAR(DB_S_PARAMUNAVAILABLE),
     VALUE_CHAR(DB_S_MULTIPLECHANGES),

	 //OLE DB Errors 1.1
     VALUE_CHAR(DB_E_BADACCESSORHANDLE),
     VALUE_CHAR(DB_E_ROWLIMITEXCEEDED),
     VALUE_CHAR(DB_E_READONLYACCESSOR),
     VALUE_CHAR(DB_E_SCHEMAVIOLATION),
     VALUE_CHAR(DB_E_BADROWHANDLE),
     VALUE_CHAR(DB_E_OBJECTOPEN),
     VALUE_CHAR(DB_E_CANTCONVERTVALUE),
     VALUE_CHAR(DB_E_BADBINDINFO),
     VALUE_CHAR(DB_SEC_E_PERMISSIONDENIED),
     VALUE_CHAR(DB_E_NOTAREFERENCECOLUMN),
     VALUE_CHAR(DB_E_NOCOMMAND),
     VALUE_CHAR(DB_E_BADBOOKMARK),
     VALUE_CHAR(DB_E_BADLOCKMODE),
     VALUE_CHAR(DB_E_PARAMNOTOPTIONAL),
     VALUE_CHAR(DB_E_BADCOLUMNID),
     VALUE_CHAR(DB_E_BADRATIO),
     VALUE_CHAR(DB_E_ERRORSINCOMMAND),
     VALUE_CHAR(DB_E_CANTCANCEL),
     VALUE_CHAR(DB_E_DIALECTNOTSUPPORTED),
     VALUE_CHAR(DB_E_DUPLICATEDATASOURCE),
     VALUE_CHAR(DB_E_CANNOTRESTART),
     VALUE_CHAR(DB_E_NOTFOUND),
     VALUE_CHAR(DB_E_NEWLYINSERTED),
     VALUE_CHAR(DB_E_UNSUPPORTEDCONVERSION),
     VALUE_CHAR(DB_E_BADSTARTPOSITION),
     VALUE_CHAR(DB_E_NOTREENTRANT),
     VALUE_CHAR(DB_E_ERRORSOCCURRED),
     VALUE_CHAR(DB_E_NOAGGREGATION),
     VALUE_CHAR(DB_E_DELETEDROW),
     VALUE_CHAR(DB_E_CANTFETCHBACKWARDS),
     VALUE_CHAR(DB_E_ROWSNOTRELEASED),
     VALUE_CHAR(DB_E_BADSTORAGEFLAG),
     VALUE_CHAR(DB_E_BADSTATUSVALUE),
     VALUE_CHAR(DB_E_CANTSCROLLBACKWARDS),
     VALUE_CHAR(DB_E_MULTIPLESTATEMENTS),
     VALUE_CHAR(DB_E_INTEGRITYVIOLATION),
     VALUE_CHAR(DB_E_BADTYPENAME),
     VALUE_CHAR(DB_E_ABORTLIMITREACHED),
     VALUE_CHAR(DB_E_DUPLICATEINDEXID),
     VALUE_CHAR(DB_E_NOINDEX),
     VALUE_CHAR(DB_E_INDEXINUSE),
     VALUE_CHAR(DB_E_NOTABLE),
     VALUE_CHAR(DB_E_CONCURRENCYVIOLATION),
     VALUE_CHAR(DB_E_BADCOPY),
     VALUE_CHAR(DB_E_BADPRECISION),
     VALUE_CHAR(DB_E_BADSCALE),
     VALUE_CHAR(DB_E_BADID),
     VALUE_CHAR(DB_E_BADTYPE),
     VALUE_CHAR(DB_E_DUPLICATECOLUMNID),
     VALUE_CHAR(DB_E_DUPLICATETABLEID),
     VALUE_CHAR(DB_E_TABLEINUSE),
     VALUE_CHAR(DB_E_NOLOCALE),
     VALUE_CHAR(DB_E_BADRECORDNUM),
     VALUE_CHAR(DB_E_BOOKMARKSKIPPED),
     VALUE_CHAR(DB_E_BADPROPERTYVALUE),
     VALUE_CHAR(DB_E_INVALID),
     VALUE_CHAR(DB_E_BADACCESSORFLAGS),
     VALUE_CHAR(DB_E_BADSTORAGEFLAGS),
     VALUE_CHAR(DB_E_BYREFACCESSORNOTSUPPORTED),
     VALUE_CHAR(DB_E_NULLACCESSORNOTSUPPORTED),
     VALUE_CHAR(DB_E_NOTPREPARED),
     VALUE_CHAR(DB_E_BADACCESSORTYPE),
     VALUE_CHAR(DB_E_WRITEONLYACCESSOR),
     VALUE_CHAR(DB_SEC_E_AUTH_FAILED),
     VALUE_CHAR(DB_E_CANCELED),
     VALUE_CHAR(DB_E_BADSOURCEHANDLE),
     VALUE_CHAR(DB_E_PARAMUNAVAILABLE),
     VALUE_CHAR(DB_E_ALREADYINITIALIZED),
     VALUE_CHAR(DB_E_NOTSUPPORTED),
     VALUE_CHAR(DB_E_MAXPENDCHANGESEXCEEDED),
     VALUE_CHAR(DB_E_BADORDINAL),
     VALUE_CHAR(DB_E_PENDINGCHANGES),
     VALUE_CHAR(DB_E_DATAOVERFLOW),
     VALUE_CHAR(DB_E_BADHRESULT),
     VALUE_CHAR(DB_E_BADLOOKUPID),
     VALUE_CHAR(DB_E_BADDYNAMICERRORID),
     VALUE_CHAR(DB_E_PENDINGINSERT),
     VALUE_CHAR(DB_E_BADCONVERTFLAG),
     VALUE_CHAR(DB_E_BADPARAMETERNAME),
     VALUE_CHAR(DB_E_MULTIPLESTORAGE),
     VALUE_CHAR(DB_E_CANTFILTER),
     VALUE_CHAR(DB_E_CANTORDER),

	 //OLE DB Warnings 1.5
     VALUE_CHAR(DB_S_ASYNCHRONOUS),
     VALUE_CHAR(DB_S_UNWANTEDOPERATION),

	 //OLE DB Warnings 2.0
	 VALUE_CHAR(DB_S_NONEXTROWSET),

	 //OLE DB Warnings 2.1
	 VALUE_CHAR(DB_S_NOTSINGLETON),
	 VALUE_CHAR(DB_S_NOROWSPECIFICCOLUMNS),

	 //OLE DB Warnings 2.5
	 VALUE_CHAR(DB_S_GOALCHANGED),
	 VALUE_CHAR(DB_S_TOOMANYCHANGES),

	 //OLE DB Errors 1.5
     VALUE_CHAR(DB_E_BADCHAPTER),
	 VALUE_CHAR(DB_E_BADCOMPAREOP),

	 //OLE DB Errors 2.0
	 VALUE_CHAR(DB_E_BADVALUES),
	 VALUE_CHAR(DB_E_NOQUERY),
	 VALUE_CHAR(DB_E_ROWSETINCOMMAND),
	 VALUE_CHAR(DB_E_CANTTRANSLATE),
	 VALUE_CHAR(DB_E_CHAPTERNOTRELEASED),

	 VALUE_CHAR(MD_E_BADTUPLE),
	 VALUE_CHAR(MD_E_BADCOORDINATE),
	 VALUE_CHAR(MD_E_INVALIDAXIS),
	 VALUE_CHAR(MD_E_INVALIDCELLRANGE),
	 VALUE_CHAR(DB_E_NOCOLUMN),
	 VALUE_CHAR(DB_E_COMMANDNOTPERSISTED),
	 VALUE_CHAR(DB_E_DUPLICATEID),
	 VALUE_CHAR(DB_E_OBJECTCREATIONLIMITREACHED),
	 VALUE_CHAR(DB_E_BADINDEXID),
	 VALUE_CHAR(DB_E_BADCOMMANDID),

	 //OLE DB Errors 2.1
     VALUE_CHAR(SEC_E_PERMISSIONDENIED),
     VALUE_CHAR(SEC_E_BADTRUSTEEID               ),
     VALUE_CHAR(SEC_E_NOTRUSTEEID                ),
     VALUE_CHAR(SEC_E_NOMEMBERSHIPSUPPORT        ),
     VALUE_CHAR(SEC_E_INVALIDOBJECT              ),
     VALUE_CHAR(SEC_E_NOOWNER                    ),
     VALUE_CHAR(SEC_E_INVALIDACCESSENTRYLIST     ),
     VALUE_CHAR(SEC_E_INVALIDOWNER               ),
     VALUE_CHAR(SEC_E_INVALIDACCESSENTRY         ),
     VALUE_CHAR(DB_E_BADCONSTRAINTTYPE           ),
     VALUE_CHAR(DB_E_BADCONSTRAINTFORM           ),
     VALUE_CHAR(DB_E_BADDEFERRABILITY            ),
     VALUE_CHAR(DB_E_BADMATCHTYPE                ),
     VALUE_CHAR(DB_E_BADUPDATEDELETERULE         ),
     VALUE_CHAR(DB_E_BADCONSTRAINTID             ),
     VALUE_CHAR(DB_E_BADCOMMANDFLAGS             ),
     VALUE_CHAR(DB_E_OBJECTMISMATCH              ),
     VALUE_CHAR(DB_E_NOSOURCEOBJECT              ),
     VALUE_CHAR(DB_E_RESOURCELOCKED              ),
     VALUE_CHAR(DB_E_NOTCOLLECTION               ),
     VALUE_CHAR(DB_E_READONLY                    ),
     VALUE_CHAR(DB_E_ASYNCNOTSUPPORTED           ),
     VALUE_CHAR(DB_E_CANNOTCONNECT               ),
     VALUE_CHAR(DB_E_TIMEOUT                     ),
     VALUE_CHAR(DB_E_RESOURCEEXISTS              ),
     VALUE_CHAR(DB_E_RESOURCEOUTOFSCOPE          ),
     VALUE_CHAR(DB_E_DROPRESTRICTED              ),
     VALUE_CHAR(DB_E_DUPLICATECONSTRAINTID       ),

	 //OLE DB Errors 2.5
     VALUE_CHAR(DB_SEC_E_SAFEMODE_DENIED	     ),
	 VALUE_CHAR(DB_E_LIMITREJECTED),
	 VALUE_CHAR(DB_E_COSTLIMIT),
	 VALUE_CHAR(DB_E_CANNOTFREE),
	 VALUE_CHAR(DB_E_GOALREJECTED),
	 VALUE_CHAR(DB_E_BADREGIONHANDLE),
	 VALUE_CHAR(DB_E_NONCONTIGUOUSRANGE),
	 VALUE_CHAR(DB_E_INVALIDTRANSITION),
	 VALUE_CHAR(DB_E_NOTASUBREGION),

	 //OLE DB Errors 2.6
	 VALUE_CHAR(DB_E_NOSTATISTIC                 ),
	 VALUE_CHAR(DB_E_ALTERRESTRICTED             ),
	 VALUE_CHAR(DB_E_RESOURCENOTSUPPORTED        ),
	 VALUE_CHAR(DB_E_NOCONSTRAINT				 ),
	 VALUE_CHAR(DB_E_COLUMNUNAVAILABLE			 ),

	 //Transactions
	 VALUE_CHAR(XACT_E_ABORTED                  ),
	 VALUE_CHAR(XACT_E_ALREADYOTHERSINGLEPHASE  ),
	 VALUE_CHAR(XACT_E_ALREADYINPROGRESS        ),
	 VALUE_CHAR(XACT_E_CANTRETAIN               ),
	 VALUE_CHAR(XACT_E_COMMITFAILED             ),
	 VALUE_CHAR(XACT_E_COMMITPREVENTED          ),
	 VALUE_CHAR(XACT_E_CONNECTION_DENIED        ),
	 VALUE_CHAR(XACT_E_CONNECTION_DOWN          ),
	 VALUE_CHAR(XACT_E_HEURISTICABORT           ),
	 VALUE_CHAR(XACT_E_HEURISTICCOMMIT          ),
	 VALUE_CHAR(XACT_E_HEURISTICDAMAGE          ),
	 VALUE_CHAR(XACT_E_HEURISTICDANGER          ),
	 VALUE_CHAR(XACT_E_INDOUBT                  ),
	 VALUE_CHAR(XACT_E_INVALIDCOOKIE            ),
	 VALUE_CHAR(XACT_E_ISOLATIONLEVEL           ),
	 VALUE_CHAR(XACT_E_LOGFULL                  ),
	 VALUE_CHAR(XACT_E_NOASYNC                  ),
	 VALUE_CHAR(XACT_E_NOENLIST                 ),
	 VALUE_CHAR(XACT_E_NOIMPORTOBJECT           ),
	 VALUE_CHAR(XACT_E_NOISORETAIN              ),
	 VALUE_CHAR(XACT_E_NORESOURCE               ),
	 VALUE_CHAR(XACT_E_NOTCURRENT               ),
	 VALUE_CHAR(XACT_E_NOTIMEOUT                ),
	 VALUE_CHAR(XACT_E_NOTRANSACTION            ),
	 VALUE_CHAR(XACT_E_NOTSUPPORTED             ),
	 VALUE_CHAR(XACT_E_REENLISTTIMEOUT          ),
	 VALUE_CHAR(XACT_E_TMNOTAVAILABLE           ),
	 VALUE_CHAR(XACT_E_UNKNOWNRMGRID            ),
	 VALUE_CHAR(XACT_E_WRONGSTATE               ),
	 VALUE_CHAR(XACT_E_WRONGUOW                 ),
	 VALUE_CHAR(XACT_E_XTIONEXISTS              ),

	 VALUE_CHAR(XACT_S_ABORTING                 ),
	 VALUE_CHAR(XACT_S_ALLNORETAIN              ),
	 VALUE_CHAR(XACT_S_ASYNC                    ),
	 VALUE_CHAR(XACT_S_DEFECT                   ),
	 VALUE_CHAR(XACT_S_OKINFORM                 ),
	 VALUE_CHAR(XACT_S_MADECHANGESCONTENT       ),
	 VALUE_CHAR(XACT_S_MADECHANGESINFORM        ),
	 VALUE_CHAR(XACT_S_READONLY                 ),
	 VALUE_CHAR(XACT_S_SINGLEPHASE              ),
	 VALUE_CHAR(XACT_S_SOMENORETAIN             ),

	 //Com Errors
	 VALUE_CHAR(CO_E_NOTINITIALIZED              ),
	 VALUE_CHAR(CO_E_ALREADYINITIALIZED          ),
	 VALUE_CHAR(CO_E_CANTDETERMINECLASS          ),
	 VALUE_CHAR(CO_E_CLASSSTRING                 ),
	 VALUE_CHAR(CO_E_IIDSTRING                   ),
	 VALUE_CHAR(CO_E_APPNOTFOUND                 ),
	 VALUE_CHAR(CO_E_APPSINGLEUSE                ),
	 VALUE_CHAR(CO_E_ERRORINAPP                  ),
	 VALUE_CHAR(CO_E_DLLNOTFOUND                 ),
	 VALUE_CHAR(CO_E_ERRORINDLL                  ),
	 VALUE_CHAR(CO_E_WRONGOSFORAPP               ),
	 VALUE_CHAR(CO_E_OBJNOTREG                   ),
	 VALUE_CHAR(CO_E_OBJISREG                    ),
	 VALUE_CHAR(CO_E_OBJNOTCONNECTED             ),
	 VALUE_CHAR(CO_E_APPDIDNTREG                 ),
	 VALUE_CHAR(CO_E_RELEASED                    ),

	 //Moniker Errors
	 VALUE_CHAR(MK_E_CONNECTMANUALLY             ),
	 VALUE_CHAR(MK_E_EXCEEDEDDEADLINE            ),
	 VALUE_CHAR(MK_E_NEEDGENERIC                 ),
	 VALUE_CHAR(MK_E_UNAVAILABLE                 ),
	 VALUE_CHAR(MK_E_SYNTAX                      ),
	 VALUE_CHAR(MK_E_NOOBJECT                    ),
	 VALUE_CHAR(MK_E_INVALIDEXTENSION            ),
	 VALUE_CHAR(MK_E_INTERMEDIATEINTERFACENOTSUPPORTED ),
	 VALUE_CHAR(MK_E_NOTBINDABLE                 ),
	 VALUE_CHAR(MK_E_NOTBOUND                    ),
	 VALUE_CHAR(MK_E_CANTOPENFILE                ),
	 VALUE_CHAR(MK_E_MUSTBOTHERUSER              ),
	 VALUE_CHAR(MK_E_NOINVERSE                   ),
	 VALUE_CHAR(MK_E_NOSTORAGE                   ),
	 VALUE_CHAR(MK_E_NOPREFIX                    ),
	 VALUE_CHAR(MK_E_ENUMERATION_FAILED          ),

	 //Connection Points
	 VALUE_CHAR(CONNECT_E_NOCONNECTION),
	 VALUE_CHAR(CONNECT_E_ADVISELIMIT),
	 VALUE_CHAR(CONNECT_E_CANNOTCONNECT),
	 VALUE_CHAR(CONNECT_E_OVERRIDDEN),

	 //Dispatch/Variant Errors
	 VALUE_CHAR(DISP_E_UNKNOWNINTERFACE),
	 VALUE_CHAR(DISP_E_MEMBERNOTFOUND),
	 VALUE_CHAR(DISP_E_PARAMNOTFOUND),
	 VALUE_CHAR(DISP_E_TYPEMISMATCH),
	 VALUE_CHAR(DISP_E_UNKNOWNNAME),
	 VALUE_CHAR(DISP_E_NONAMEDARGS),
	 VALUE_CHAR(DISP_E_BADVARTYPE),
	 VALUE_CHAR(DISP_E_EXCEPTION),
	 VALUE_CHAR(DISP_E_OVERFLOW),
	 VALUE_CHAR(DISP_E_BADINDEX),
	 VALUE_CHAR(DISP_E_UNKNOWNLCID),
	 VALUE_CHAR(DISP_E_ARRAYISLOCKED),
	 VALUE_CHAR(DISP_E_BADPARAMCOUNT),
	 VALUE_CHAR(DISP_E_PARAMNOTOPTIONAL),
	 VALUE_CHAR(DISP_E_BADCALLEE),
	 VALUE_CHAR(DISP_E_NOTACOLLECTION),

	 //DataSource Locator Errors
	 VALUE_CHAR(DB_E_BADINITSTRING),
	 VALUE_CHAR(DB_E_NOPROVIDERSREGISTERED),
	 VALUE_CHAR(DB_E_MISMATCHEDPROVIDER),

	//STG Errors
	VALUE_CHAR(STG_E_INVALIDFUNCTION            ),
	VALUE_CHAR(STG_E_FILENOTFOUND               ),
	VALUE_CHAR(STG_E_PATHNOTFOUND               ),
	VALUE_CHAR(STG_E_TOOMANYOPENFILES           ),
	VALUE_CHAR(STG_E_ACCESSDENIED               ),
	VALUE_CHAR(STG_E_INVALIDHANDLE              ),
	VALUE_CHAR(STG_E_INSUFFICIENTMEMORY         ),
	VALUE_CHAR(STG_E_INVALIDPOINTER             ),
	VALUE_CHAR(STG_E_NOMOREFILES                ),
	VALUE_CHAR(STG_E_DISKISWRITEPROTECTED       ),
	VALUE_CHAR(STG_E_SEEKERROR                  ),
	VALUE_CHAR(STG_E_WRITEFAULT                 ),
	VALUE_CHAR(STG_E_READFAULT                  ),
	VALUE_CHAR(STG_E_SHAREVIOLATION             ),
	VALUE_CHAR(STG_E_LOCKVIOLATION              ),
	VALUE_CHAR(STG_E_FILEALREADYEXISTS          ),
	VALUE_CHAR(STG_E_INVALIDPARAMETER           ),
	VALUE_CHAR(STG_E_MEDIUMFULL                 ),
	VALUE_CHAR(STG_E_PROPSETMISMATCHED          ),
	VALUE_CHAR(STG_E_ABNORMALAPIEXIT            ),
	VALUE_CHAR(STG_E_INVALIDHEADER              ),
	VALUE_CHAR(STG_E_INVALIDNAME                ),
	VALUE_CHAR(STG_E_UNKNOWN                    ),
	VALUE_CHAR(STG_E_UNIMPLEMENTEDFUNCTION      ),
	VALUE_CHAR(STG_E_INVALIDFLAG                ),
	VALUE_CHAR(STG_E_INUSE                      ),
	VALUE_CHAR(STG_E_NOTCURRENT                 ),
	VALUE_CHAR(STG_E_REVERTED                   ),
	VALUE_CHAR(STG_E_CANTSAVE                   ),
	VALUE_CHAR(STG_E_OLDFORMAT                  ),
	VALUE_CHAR(STG_E_OLDDLL                     ),
	VALUE_CHAR(STG_E_SHAREREQUIRED              ),
	VALUE_CHAR(STG_E_NOTFILEBASEDSTORAGE        ),
	VALUE_CHAR(STG_E_EXTANTMARSHALLINGS         ),
	VALUE_CHAR(STG_E_DOCFILECORRUPT             ),
	VALUE_CHAR(STG_E_BADBASEADDRESS             ),
	VALUE_CHAR(STG_E_INCOMPLETE                 ),
	VALUE_CHAR(STG_E_TERMINATED                 ),
	VALUE_CHAR(STG_S_CONVERTED                  ),
	VALUE_CHAR(STG_S_BLOCK                      ),
	VALUE_CHAR(STG_S_RETRYNOW                   ),
	VALUE_CHAR(STG_S_MONITORING                 ),

	 //RPC Errors
	VALUE_CHAR( CO_E_INIT_TLS                    ),
	VALUE_CHAR( CO_E_INIT_SHARED_ALLOCATOR       ),
	VALUE_CHAR( CO_E_INIT_MEMORY_ALLOCATOR       ),
	VALUE_CHAR( CO_E_INIT_CLASS_CACHE            ),
	VALUE_CHAR( CO_E_INIT_RPC_CHANNEL            ),
	VALUE_CHAR( CO_E_INIT_TLS_SET_CHANNEL_CONTROL ),
	VALUE_CHAR( CO_E_INIT_TLS_CHANNEL_CONTROL    ),
	VALUE_CHAR( CO_E_INIT_UNACCEPTED_USER_ALLOCATOR ),
	VALUE_CHAR( CO_E_INIT_SCM_MUTEX_EXISTS       ),
	VALUE_CHAR( CO_E_INIT_SCM_FILE_MAPPING_EXISTS ),
	VALUE_CHAR( CO_E_INIT_SCM_MAP_VIEW_OF_FILE   ),
	VALUE_CHAR( CO_E_INIT_SCM_EXEC_FAILURE       ),
	VALUE_CHAR( CO_E_INIT_ONLY_SINGLE_THREADED   ),
	VALUE_CHAR( CO_E_CANT_REMOTE                 ),
	VALUE_CHAR( CO_E_BAD_SERVER_NAME             ),
	VALUE_CHAR( CO_E_WRONG_SERVER_IDENTITY       ),
	VALUE_CHAR( CO_E_OLE1DDE_DISABLED            ),
	VALUE_CHAR( CO_E_RUNAS_SYNTAX                ),
	VALUE_CHAR( CO_E_CREATEPROCESS_FAILURE       ),
	VALUE_CHAR( CO_E_RUNAS_CREATEPROCESS_FAILURE ),
	VALUE_CHAR( CO_E_RUNAS_LOGON_FAILURE         ),
	VALUE_CHAR( CO_E_LAUNCH_PERMSSION_DENIED     ),
	VALUE_CHAR( CO_E_START_SERVICE_FAILURE       ),
	VALUE_CHAR( CO_E_REMOTE_COMMUNICATION_FAILURE ),
	VALUE_CHAR( CO_E_SERVER_START_TIMEOUT        ),
	VALUE_CHAR( CO_E_CLSREG_INCONSISTENT         ),
	VALUE_CHAR( CO_E_IIDREG_INCONSISTENT         ),
	VALUE_CHAR( CO_E_NOT_SUPPORTED               ),

	//RPC Errors
     VALUE_CHAR_HR(ERROR_BAD_FORMAT                 ),         
     VALUE_CHAR_HR(ERROR_INVALID_ACCESS             ),
     VALUE_CHAR_HR(ERROR_INVALID_DATA               ),
     VALUE_CHAR_HR(ERROR_OUTOFMEMORY                ),
     VALUE_CHAR_HR(ERROR_INVALID_DRIVE              ),
     VALUE_CHAR_HR(ERROR_CURRENT_DIRECTORY          ),
     VALUE_CHAR_HR(ERROR_NOT_SAME_DEVICE            ),
     VALUE_CHAR_HR(ERROR_NO_MORE_FILES              ),
     VALUE_CHAR_HR(ERROR_WRITE_PROTECT              ),
     VALUE_CHAR_HR(ERROR_BAD_UNIT                   ),
     VALUE_CHAR_HR(ERROR_NOT_READY                  ),
     VALUE_CHAR_HR(ERROR_BAD_COMMAND                ),
     VALUE_CHAR_HR(ERROR_CRC                        ),
     VALUE_CHAR_HR(ERROR_BAD_LENGTH                 ),
     VALUE_CHAR_HR(ERROR_SEEK                       ),
     VALUE_CHAR_HR(ERROR_NOT_DOS_DISK               ),
     VALUE_CHAR_HR(ERROR_SECTOR_NOT_FOUND           ),
     VALUE_CHAR_HR(ERROR_OUT_OF_PAPER               ),
     VALUE_CHAR_HR(ERROR_WRITE_FAULT                ),
     VALUE_CHAR_HR(ERROR_READ_FAULT                 ),
     VALUE_CHAR_HR(ERROR_GEN_FAILURE                ),
     VALUE_CHAR_HR(ERROR_SHARING_VIOLATION          ),
     VALUE_CHAR_HR(ERROR_LOCK_VIOLATION             ),
     VALUE_CHAR_HR(ERROR_WRONG_DISK                 ),
     VALUE_CHAR_HR(ERROR_SHARING_BUFFER_EXCEEDED    ),
     VALUE_CHAR_HR(ERROR_HANDLE_EOF                 ),
     VALUE_CHAR_HR(ERROR_HANDLE_DISK_FULL           ),
     VALUE_CHAR_HR(ERROR_NOT_SUPPORTED              ),
     VALUE_CHAR_HR(ERROR_REM_NOT_LIST               ),
     VALUE_CHAR_HR(ERROR_DUP_NAME                   ),
     VALUE_CHAR_HR(ERROR_BAD_NETPATH                ),
     VALUE_CHAR_HR(ERROR_NETWORK_BUSY               ),
     VALUE_CHAR_HR(ERROR_DEV_NOT_EXIST              ),    
     VALUE_CHAR_HR(ERROR_TOO_MANY_CMDS              ),
     VALUE_CHAR_HR(ERROR_ADAP_HDW_ERR               ),
     VALUE_CHAR_HR(ERROR_BAD_NET_RESP               ),
     VALUE_CHAR_HR(ERROR_UNEXP_NET_ERR              ),
     VALUE_CHAR_HR(ERROR_BAD_REM_ADAP               ),
     VALUE_CHAR_HR(ERROR_PRINTQ_FULL                ),
     VALUE_CHAR_HR(ERROR_NO_SPOOL_SPACE             ),
     VALUE_CHAR_HR(ERROR_PRINT_CANCELLED            ),
     VALUE_CHAR_HR(ERROR_NETNAME_DELETED            ),
     VALUE_CHAR_HR(ERROR_NETWORK_ACCESS_DENIED      ),
     VALUE_CHAR_HR(ERROR_BAD_DEV_TYPE               ),
     VALUE_CHAR_HR(ERROR_BAD_NET_NAME               ),
     VALUE_CHAR_HR(ERROR_TOO_MANY_NAMES             ),
     VALUE_CHAR_HR(ERROR_TOO_MANY_SESS              ),
     VALUE_CHAR_HR(ERROR_SHARING_PAUSED             ),
     VALUE_CHAR_HR(ERROR_REQ_NOT_ACCEP              ),
     VALUE_CHAR_HR(ERROR_REDIR_PAUSED               ),
     VALUE_CHAR_HR(ERROR_FILE_EXISTS                ),
     VALUE_CHAR_HR(ERROR_CANNOT_MAKE                ),
     VALUE_CHAR_HR(ERROR_FAIL_I24                   ),
     VALUE_CHAR_HR(ERROR_OUT_OF_STRUCTURES          ),
     VALUE_CHAR_HR(ERROR_ALREADY_ASSIGNED           ),
     VALUE_CHAR_HR(ERROR_INVALID_PASSWORD           ),
     VALUE_CHAR_HR(ERROR_INVALID_PARAMETER          ),    
     VALUE_CHAR_HR(ERROR_NET_WRITE_FAULT            ),
     VALUE_CHAR_HR(ERROR_NO_PROC_SLOTS              ),
     VALUE_CHAR_HR(ERROR_TOO_MANY_SEMAPHORES        ),
     VALUE_CHAR_HR(ERROR_EXCL_SEM_ALREADY_OWNED     ),
     VALUE_CHAR_HR(ERROR_SEM_IS_SET                 ),
     VALUE_CHAR_HR(ERROR_TOO_MANY_SEM_REQUESTS      ),
     VALUE_CHAR_HR(ERROR_INVALID_AT_INTERRUPT_TIME  ),
     VALUE_CHAR_HR(ERROR_SEM_OWNER_DIED             ),
     VALUE_CHAR_HR(ERROR_SEM_USER_LIMIT             ),
     VALUE_CHAR_HR(ERROR_DISK_CHANGE                ),
     VALUE_CHAR_HR(ERROR_DRIVE_LOCKED               ),
     VALUE_CHAR_HR(ERROR_BROKEN_PIPE                ),
     VALUE_CHAR_HR(ERROR_OPEN_FAILED                ),
     VALUE_CHAR_HR(ERROR_BUFFER_OVERFLOW            ),
     VALUE_CHAR_HR(ERROR_DISK_FULL                  ),
     VALUE_CHAR_HR(ERROR_NO_MORE_SEARCH_HANDLES     ),
     VALUE_CHAR_HR(ERROR_INVALID_TARGET_HANDLE      ),
     VALUE_CHAR_HR(ERROR_INVALID_CATEGORY           ),
     VALUE_CHAR_HR(ERROR_INVALID_VERIFY_SWITCH      ),
     VALUE_CHAR_HR(ERROR_BAD_DRIVER_LEVEL           ),
     VALUE_CHAR_HR(ERROR_CALL_NOT_IMPLEMENTED       ),
     VALUE_CHAR_HR(ERROR_SEM_TIMEOUT                ),
     VALUE_CHAR_HR(ERROR_INSUFFICIENT_BUFFER        ),    
     VALUE_CHAR_HR(ERROR_INVALID_NAME               ),
     VALUE_CHAR_HR(ERROR_INVALID_LEVEL              ),
     VALUE_CHAR_HR(ERROR_NO_VOLUME_LABEL            ),
     VALUE_CHAR_HR(ERROR_MOD_NOT_FOUND              ),
     VALUE_CHAR_HR(ERROR_PROC_NOT_FOUND             ),
     VALUE_CHAR_HR(ERROR_WAIT_NO_CHILDREN           ),
     VALUE_CHAR_HR(ERROR_CHILD_NOT_COMPLETE         ),
     VALUE_CHAR_HR(ERROR_DIRECT_ACCESS_HANDLE       ),
     VALUE_CHAR_HR(ERROR_NEGATIVE_SEEK              ),
     VALUE_CHAR_HR(ERROR_SEEK_ON_DEVICE             ),
     VALUE_CHAR_HR(ERROR_IS_JOIN_TARGET             ),
     VALUE_CHAR_HR(ERROR_IS_JOINED                  ),
     VALUE_CHAR_HR(ERROR_IS_SUBSTED                 ),
     VALUE_CHAR_HR(ERROR_NOT_JOINED                 ),
     VALUE_CHAR_HR(ERROR_NOT_SUBSTED                ),
     VALUE_CHAR_HR(ERROR_JOIN_TO_JOIN               ),
     VALUE_CHAR_HR(ERROR_SUBST_TO_SUBST             ),
     VALUE_CHAR_HR(ERROR_JOIN_TO_SUBST              ),
     VALUE_CHAR_HR(ERROR_SUBST_TO_JOIN              ),
     VALUE_CHAR_HR(ERROR_BUSY_DRIVE                 ),
     VALUE_CHAR_HR(ERROR_SAME_DRIVE                 ),
     VALUE_CHAR_HR(ERROR_DIR_NOT_ROOT               ),
     VALUE_CHAR_HR(ERROR_DIR_NOT_EMPTY              ),
     VALUE_CHAR_HR(ERROR_IS_SUBST_PATH              ),
     VALUE_CHAR_HR(ERROR_IS_JOIN_PATH               ),
     VALUE_CHAR_HR(ERROR_PATH_BUSY                  ),
     VALUE_CHAR_HR(ERROR_IS_SUBST_TARGET            ),
     VALUE_CHAR_HR(ERROR_SYSTEM_TRACE               ),
     VALUE_CHAR_HR(ERROR_INVALID_EVENT_COUNT        ),
     VALUE_CHAR_HR(ERROR_TOO_MANY_MUXWAITERS        ),
     VALUE_CHAR_HR(ERROR_INVALID_LIST_FORMAT        ),
     VALUE_CHAR_HR(ERROR_LABEL_TOO_LONG             ),
     VALUE_CHAR_HR(ERROR_TOO_MANY_TCBS              ),
     VALUE_CHAR_HR(ERROR_SIGNAL_REFUSED             ),
     VALUE_CHAR_HR(ERROR_DISCARDED                  ),
     VALUE_CHAR_HR(ERROR_NOT_LOCKED                 ),
     VALUE_CHAR_HR(ERROR_BAD_THREADID_ADDR          ),
     VALUE_CHAR_HR(ERROR_BAD_ARGUMENTS              ),
     VALUE_CHAR_HR(ERROR_BAD_PATHNAME               ),
     VALUE_CHAR_HR(ERROR_SIGNAL_PENDING             ),
     VALUE_CHAR_HR(ERROR_MAX_THRDS_REACHED          ),
     VALUE_CHAR_HR(ERROR_LOCK_FAILED                ),
     VALUE_CHAR_HR(ERROR_BUSY                       ),
     VALUE_CHAR_HR(ERROR_CANCEL_VIOLATION           ),
     VALUE_CHAR_HR(ERROR_ATOMIC_LOCKS_NOT_SUPPORTED ),
     VALUE_CHAR_HR(ERROR_INVALID_SEGMENT_NUMBER     ),
     VALUE_CHAR_HR(ERROR_INVALID_ORDINAL            ),
     VALUE_CHAR_HR(ERROR_ALREADY_EXISTS             ),
     VALUE_CHAR_HR(ERROR_INVALID_FLAG_NUMBER        ),
     VALUE_CHAR_HR(ERROR_SEM_NOT_FOUND              ),
     VALUE_CHAR_HR(ERROR_INVALID_STARTING_CODESEG   ),
     VALUE_CHAR_HR(ERROR_INVALID_STACKSEG           ),
     VALUE_CHAR_HR(ERROR_INVALID_MODULETYPE         ),
     VALUE_CHAR_HR(ERROR_INVALID_EXE_SIGNATURE      ),
     VALUE_CHAR_HR(ERROR_EXE_MARKED_INVALID         ),
     VALUE_CHAR_HR(ERROR_BAD_EXE_FORMAT             ),
     VALUE_CHAR_HR(ERROR_ITERATED_DATA_EXCEEDS_64k  ),
     VALUE_CHAR_HR(ERROR_INVALID_MINALLOCSIZE       ),
     VALUE_CHAR_HR(ERROR_DYNLINK_FROM_INVALID_RING  ),
     VALUE_CHAR_HR(ERROR_IOPL_NOT_ENABLED           ),
     VALUE_CHAR_HR(ERROR_INVALID_SEGDPL             ),
     VALUE_CHAR_HR(ERROR_AUTODATASEG_EXCEEDS_64k    ),
     VALUE_CHAR_HR(ERROR_RING2SEG_MUST_BE_MOVABLE   ),
     VALUE_CHAR_HR(ERROR_RELOC_CHAIN_XEEDS_SEGLIM   ),
     VALUE_CHAR_HR(ERROR_INFLOOP_IN_RELOC_CHAIN     ),
     VALUE_CHAR_HR(ERROR_ENVVAR_NOT_FOUND           ),
     VALUE_CHAR_HR(ERROR_NO_SIGNAL_SENT             ),
     VALUE_CHAR_HR(ERROR_FILENAME_EXCED_RANGE       ),
     VALUE_CHAR_HR(ERROR_RING2_STACK_IN_USE         ),
     VALUE_CHAR_HR(ERROR_META_EXPANSION_TOO_LONG    ),
     VALUE_CHAR_HR(ERROR_INVALID_SIGNAL_NUMBER      ),
     VALUE_CHAR_HR(ERROR_THREAD_1_INACTIVE          ),
     VALUE_CHAR_HR(ERROR_LOCKED                     ),
     VALUE_CHAR_HR(ERROR_TOO_MANY_MODULES           ),
     VALUE_CHAR_HR(ERROR_NESTING_NOT_ALLOWED        ),
     VALUE_CHAR_HR(ERROR_EXE_MACHINE_TYPE_MISMATCH  ),
     VALUE_CHAR_HR(ERROR_BAD_PIPE                   ),
     VALUE_CHAR_HR(ERROR_PIPE_BUSY                  ),
     VALUE_CHAR_HR(ERROR_NO_DATA                    ),
     VALUE_CHAR_HR(ERROR_PIPE_NOT_CONNECTED         ),
     VALUE_CHAR_HR(ERROR_MORE_DATA                  ),
     VALUE_CHAR_HR(ERROR_VC_DISCONNECTED            ),
     VALUE_CHAR_HR(ERROR_INVALID_EA_NAME            ),
     VALUE_CHAR_HR(ERROR_EA_LIST_INCONSISTENT       ),
     VALUE_CHAR_HR(ERROR_NO_MORE_ITEMS              ),
     VALUE_CHAR_HR(ERROR_CANNOT_COPY                ),
     VALUE_CHAR_HR(ERROR_DIRECTORY                  ),
     VALUE_CHAR_HR(ERROR_EAS_DIDNT_FIT              ),
     VALUE_CHAR_HR(ERROR_EA_FILE_CORRUPT            ),
     VALUE_CHAR_HR(ERROR_EA_TABLE_FULL              ),
     VALUE_CHAR_HR(ERROR_INVALID_EA_HANDLE          ),
     VALUE_CHAR_HR(ERROR_EAS_NOT_SUPPORTED          ),
     VALUE_CHAR_HR(ERROR_NOT_OWNER                  ),
     VALUE_CHAR_HR(ERROR_TOO_MANY_POSTS             ),
     VALUE_CHAR_HR(ERROR_PARTIAL_COPY               ),
     VALUE_CHAR_HR(ERROR_MR_MID_NOT_FOUND           ),
     VALUE_CHAR_HR(ERROR_INVALID_ADDRESS            ),
     VALUE_CHAR_HR(ERROR_ARITHMETIC_OVERFLOW        ),
     VALUE_CHAR_HR(ERROR_PIPE_CONNECTED             ),
     VALUE_CHAR_HR(ERROR_PIPE_LISTENING             ),
     VALUE_CHAR_HR(ERROR_EA_ACCESS_DENIED           ),
     VALUE_CHAR_HR(ERROR_OPERATION_ABORTED          ),
     VALUE_CHAR_HR(ERROR_IO_INCOMPLETE              ),
     VALUE_CHAR_HR(ERROR_IO_PENDING                 ),
     VALUE_CHAR_HR(ERROR_NOACCESS                   ),
     VALUE_CHAR_HR(ERROR_SWAPERROR                  ),
     VALUE_CHAR_HR(ERROR_STACK_OVERFLOW             ),
     VALUE_CHAR_HR(ERROR_INVALID_MESSAGE            ),
     VALUE_CHAR_HR(ERROR_CAN_NOT_COMPLETE           ),
     VALUE_CHAR_HR(ERROR_INVALID_FLAGS              ),
     VALUE_CHAR_HR(ERROR_UNRECOGNIZED_VOLUME        ),
     VALUE_CHAR_HR(ERROR_FILE_INVALID               ),
     VALUE_CHAR_HR(ERROR_FULLSCREEN_MODE            ),
     VALUE_CHAR_HR(ERROR_NO_TOKEN                   ),
     VALUE_CHAR_HR(ERROR_BADDB                      ),
     VALUE_CHAR_HR(ERROR_BADKEY                     ),
     VALUE_CHAR_HR(ERROR_CANTOPEN                   ),
     VALUE_CHAR_HR(ERROR_CANTREAD                   ),
     VALUE_CHAR_HR(ERROR_CANTWRITE                  ),
     VALUE_CHAR_HR(ERROR_REGISTRY_RECOVERED         ),
     VALUE_CHAR_HR(ERROR_REGISTRY_CORRUPT           ),
     VALUE_CHAR_HR(ERROR_REGISTRY_IO_FAILED         ),
     VALUE_CHAR_HR(ERROR_NOT_REGISTRY_FILE          ),
     VALUE_CHAR_HR(ERROR_KEY_DELETED                ),
     VALUE_CHAR_HR(ERROR_NO_LOG_SPACE               ),
     VALUE_CHAR_HR(ERROR_KEY_HAS_CHILDREN           ),
     VALUE_CHAR_HR(ERROR_CHILD_MUST_BE_VOLATILE     ),
     VALUE_CHAR_HR(ERROR_NOTIFY_ENUM_DIR            ),
     VALUE_CHAR_HR(ERROR_DEPENDENT_SERVICES_RUNNING ),
     VALUE_CHAR_HR(ERROR_INVALID_SERVICE_CONTROL    ),
     VALUE_CHAR_HR(ERROR_SERVICE_REQUEST_TIMEOUT    ),
     VALUE_CHAR_HR(ERROR_SERVICE_NO_THREAD          ),
     VALUE_CHAR_HR(ERROR_SERVICE_DATABASE_LOCKED    ),
     VALUE_CHAR_HR(ERROR_SERVICE_ALREADY_RUNNING    ),
     VALUE_CHAR_HR(ERROR_INVALID_SERVICE_ACCOUNT    ),
     VALUE_CHAR_HR(ERROR_SERVICE_DISABLED           ),
     VALUE_CHAR_HR(ERROR_CIRCULAR_DEPENDENCY        ),
     VALUE_CHAR_HR(ERROR_SERVICE_DOES_NOT_EXIST     ),
     VALUE_CHAR_HR(ERROR_SERVICE_CANNOT_ACCEPT_CTRL ),
     VALUE_CHAR_HR(ERROR_SERVICE_NOT_ACTIVE         ),
     VALUE_CHAR_HR(ERROR_FAILED_SERVICE_CONTROLLER_CONNECT ),
     VALUE_CHAR_HR(ERROR_EXCEPTION_IN_SERVICE       ),
     VALUE_CHAR_HR(ERROR_DATABASE_DOES_NOT_EXIST    ),
     VALUE_CHAR_HR(ERROR_SERVICE_SPECIFIC_ERROR     ),
     VALUE_CHAR_HR(ERROR_PROCESS_ABORTED            ),
     VALUE_CHAR_HR(ERROR_SERVICE_DEPENDENCY_FAIL    ),
     VALUE_CHAR_HR(ERROR_SERVICE_LOGON_FAILED       ),
     VALUE_CHAR_HR(ERROR_SERVICE_START_HANG         ),
     VALUE_CHAR_HR(ERROR_INVALID_SERVICE_LOCK       ),
     VALUE_CHAR_HR(ERROR_SERVICE_MARKED_FOR_DELETE  ),
     VALUE_CHAR_HR(ERROR_SERVICE_EXISTS             ),
     VALUE_CHAR_HR(ERROR_ALREADY_RUNNING_LKG        ),
     VALUE_CHAR_HR(ERROR_SERVICE_DEPENDENCY_DELETED ),
     VALUE_CHAR_HR(ERROR_BOOT_ALREADY_ACCEPTED      ),
     VALUE_CHAR_HR(ERROR_SERVICE_NEVER_STARTED      ),
     VALUE_CHAR_HR(ERROR_DUPLICATE_SERVICE_NAME     ),
     VALUE_CHAR_HR(ERROR_DIFFERENT_SERVICE_ACCOUNT  ),
     VALUE_CHAR_HR(ERROR_END_OF_MEDIA               ),
     VALUE_CHAR_HR(ERROR_FILEMARK_DETECTED          ),
     VALUE_CHAR_HR(ERROR_BEGINNING_OF_MEDIA         ),
     VALUE_CHAR_HR(ERROR_SETMARK_DETECTED           ),
     VALUE_CHAR_HR(ERROR_NO_DATA_DETECTED           ),
     VALUE_CHAR_HR(ERROR_PARTITION_FAILURE          ),
     VALUE_CHAR_HR(ERROR_INVALID_BLOCK_LENGTH       ),
     VALUE_CHAR_HR(ERROR_DEVICE_NOT_PARTITIONED     ),
     VALUE_CHAR_HR(ERROR_UNABLE_TO_LOCK_MEDIA       ),
     VALUE_CHAR_HR(ERROR_UNABLE_TO_UNLOAD_MEDIA     ),
     VALUE_CHAR_HR(ERROR_MEDIA_CHANGED              ),
     VALUE_CHAR_HR(ERROR_BUS_RESET                  ),
     VALUE_CHAR_HR(ERROR_NO_MEDIA_IN_DRIVE          ),
     VALUE_CHAR_HR(ERROR_NO_UNICODE_TRANSLATION     ),
     VALUE_CHAR_HR(ERROR_DLL_INIT_FAILED            ),
     VALUE_CHAR_HR(ERROR_SHUTDOWN_IN_PROGRESS       ),
     VALUE_CHAR_HR(ERROR_NO_SHUTDOWN_IN_PROGRESS    ),
     VALUE_CHAR_HR(ERROR_IO_DEVICE                  ),
     VALUE_CHAR_HR(ERROR_SERIAL_NO_DEVICE           ),
     VALUE_CHAR_HR(ERROR_IRQ_BUSY                   ),
     VALUE_CHAR_HR(ERROR_MORE_WRITES                ),
     VALUE_CHAR_HR(ERROR_COUNTER_TIMEOUT            ),
     VALUE_CHAR_HR(ERROR_FLOPPY_ID_MARK_NOT_FOUND   ),
     VALUE_CHAR_HR(ERROR_FLOPPY_WRONG_CYLINDER      ),
     VALUE_CHAR_HR(ERROR_FLOPPY_UNKNOWN_ERROR       ),
     VALUE_CHAR_HR(ERROR_FLOPPY_BAD_REGISTERS       ),
     VALUE_CHAR_HR(ERROR_DISK_RECALIBRATE_FAILED    ),
     VALUE_CHAR_HR(ERROR_DISK_OPERATION_FAILED      ),
     VALUE_CHAR_HR(ERROR_DISK_RESET_FAILED          ),
     VALUE_CHAR_HR(ERROR_EOM_OVERFLOW               ),
     VALUE_CHAR_HR(ERROR_NOT_ENOUGH_SERVER_MEMORY   ),
     VALUE_CHAR_HR(ERROR_POSSIBLE_DEADLOCK          ),
     VALUE_CHAR_HR(ERROR_MAPPED_ALIGNMENT           ),
     VALUE_CHAR_HR(ERROR_SET_POWER_STATE_VETOED     ),
     VALUE_CHAR_HR(ERROR_SET_POWER_STATE_FAILED     ),
     VALUE_CHAR_HR(ERROR_TOO_MANY_LINKS             ),
     VALUE_CHAR_HR(ERROR_OLD_WIN_VERSION            ),
     VALUE_CHAR_HR(ERROR_APP_WRONG_OS               ),
     VALUE_CHAR_HR(ERROR_SINGLE_INSTANCE_APP        ),
     VALUE_CHAR_HR(ERROR_RMODE_APP                  ),
     VALUE_CHAR_HR(ERROR_INVALID_DLL                ),
     VALUE_CHAR_HR(ERROR_NO_ASSOCIATION             ),
     VALUE_CHAR_HR(ERROR_DDE_FAIL                   ),
     VALUE_CHAR_HR(ERROR_DLL_NOT_FOUND              ),
     VALUE_CHAR_HR(ERROR_BAD_USERNAME               ),
     VALUE_CHAR_HR(ERROR_NOT_CONNECTED              ),
     VALUE_CHAR_HR(ERROR_OPEN_FILES                 ),
     VALUE_CHAR_HR(ERROR_ACTIVE_CONNECTIONS         ),
     VALUE_CHAR_HR(ERROR_DEVICE_IN_USE              ),
     VALUE_CHAR_HR(ERROR_BAD_DEVICE                 ),
     VALUE_CHAR_HR(ERROR_CONNECTION_UNAVAIL         ),
     VALUE_CHAR_HR(ERROR_DEVICE_ALREADY_REMEMBERED  ),
     VALUE_CHAR_HR(ERROR_NO_NET_OR_BAD_PATH         ),
     VALUE_CHAR_HR(ERROR_BAD_PROVIDER               ),
     VALUE_CHAR_HR(ERROR_CANNOT_OPEN_PROFILE        ),
     VALUE_CHAR_HR(ERROR_BAD_PROFILE                ),
     VALUE_CHAR_HR(ERROR_NOT_CONTAINER              ),
     VALUE_CHAR_HR(ERROR_EXTENDED_ERROR             ),
     VALUE_CHAR_HR(ERROR_INVALID_GROUPNAME          ),
     VALUE_CHAR_HR(ERROR_INVALID_COMPUTERNAME       ),
     VALUE_CHAR_HR(ERROR_INVALID_EVENTNAME          ),
     VALUE_CHAR_HR(ERROR_INVALID_DOMAINNAME         ),
     VALUE_CHAR_HR(ERROR_INVALID_SERVICENAME        ),
     VALUE_CHAR_HR(ERROR_INVALID_NETNAME            ),
     VALUE_CHAR_HR(ERROR_INVALID_SHARENAME          ),
     VALUE_CHAR_HR(ERROR_INVALID_PASSWORDNAME       ),
     VALUE_CHAR_HR(ERROR_INVALID_MESSAGENAME        ),
     VALUE_CHAR_HR(ERROR_INVALID_MESSAGEDEST        ),
     VALUE_CHAR_HR(ERROR_SESSION_CREDENTIAL_CONFLICT ),
     VALUE_CHAR_HR(ERROR_REMOTE_SESSION_LIMIT_EXCEEDED ),
     VALUE_CHAR_HR(ERROR_DUP_DOMAINNAME             ),
     VALUE_CHAR_HR(ERROR_NO_NETWORK                 ),
     VALUE_CHAR_HR(ERROR_CANCELLED                  ),
     VALUE_CHAR_HR(ERROR_USER_MAPPED_FILE           ),
     VALUE_CHAR_HR(ERROR_CONNECTION_REFUSED         ),
     VALUE_CHAR_HR(ERROR_GRACEFUL_DISCONNECT        ),
     VALUE_CHAR_HR(ERROR_ADDRESS_ALREADY_ASSOCIATED ),
     VALUE_CHAR_HR(ERROR_ADDRESS_NOT_ASSOCIATED     ),
     VALUE_CHAR_HR(ERROR_CONNECTION_INVALID         ),
     VALUE_CHAR_HR(ERROR_CONNECTION_ACTIVE          ),
     VALUE_CHAR_HR(ERROR_NETWORK_UNREACHABLE        ),
     VALUE_CHAR_HR(ERROR_HOST_UNREACHABLE           ),
     VALUE_CHAR_HR(ERROR_PROTOCOL_UNREACHABLE       ),
     VALUE_CHAR_HR(ERROR_PORT_UNREACHABLE           ),
     VALUE_CHAR_HR(ERROR_REQUEST_ABORTED            ),
     VALUE_CHAR_HR(ERROR_CONNECTION_ABORTED         ),
     VALUE_CHAR_HR(ERROR_RETRY                      ),
     VALUE_CHAR_HR(ERROR_CONNECTION_COUNT_LIMIT     ),
     VALUE_CHAR_HR(ERROR_LOGIN_TIME_RESTRICTION     ),
     VALUE_CHAR_HR(ERROR_LOGIN_WKSTA_RESTRICTION    ),
     VALUE_CHAR_HR(ERROR_INCORRECT_ADDRESS          ),
     VALUE_CHAR_HR(ERROR_ALREADY_REGISTERED         ),
     VALUE_CHAR_HR(ERROR_SERVICE_NOT_FOUND          ),
     VALUE_CHAR_HR(ERROR_NOT_AUTHENTICATED          ),
     VALUE_CHAR_HR(ERROR_NOT_LOGGED_ON              ),
     VALUE_CHAR_HR(ERROR_CONTINUE                   ),
     VALUE_CHAR_HR(ERROR_ALREADY_INITIALIZED        ),
     VALUE_CHAR_HR(ERROR_NO_MORE_DEVICES            ),
     VALUE_CHAR_HR(ERROR_NOT_ALL_ASSIGNED           ),
     VALUE_CHAR_HR(ERROR_SOME_NOT_MAPPED            ),
     VALUE_CHAR_HR(ERROR_NO_QUOTAS_FOR_ACCOUNT      ),
     VALUE_CHAR_HR(ERROR_LOCAL_USER_SESSION_KEY     ),
     VALUE_CHAR_HR(ERROR_NULL_LM_PASSWORD           ),
     VALUE_CHAR_HR(ERROR_UNKNOWN_REVISION           ),
     VALUE_CHAR_HR(ERROR_REVISION_MISMATCH          ),
     VALUE_CHAR_HR(ERROR_INVALID_OWNER              ),
     VALUE_CHAR_HR(ERROR_INVALID_PRIMARY_GROUP      ),
     VALUE_CHAR_HR(ERROR_NO_IMPERSONATION_TOKEN     ),
     VALUE_CHAR_HR(ERROR_CANT_DISABLE_MANDATORY     ),
     VALUE_CHAR_HR(ERROR_NO_LOGON_SERVERS           ),

     VALUE_CHAR_HR(ERROR_NO_SUCH_LOGON_SESSION      ),
     VALUE_CHAR_HR(ERROR_NO_SUCH_PRIVILEGE          ),
     VALUE_CHAR_HR(ERROR_PRIVILEGE_NOT_HELD         ),
     VALUE_CHAR_HR(ERROR_INVALID_ACCOUNT_NAME       ),
     VALUE_CHAR_HR(ERROR_USER_EXISTS                ),
     VALUE_CHAR_HR(ERROR_NO_SUCH_USER               ),
     VALUE_CHAR_HR(ERROR_GROUP_EXISTS               ),
     VALUE_CHAR_HR(ERROR_NO_SUCH_GROUP              ),
     VALUE_CHAR_HR(ERROR_MEMBER_IN_GROUP            ),
     VALUE_CHAR_HR(ERROR_MEMBER_NOT_IN_GROUP        ),
     VALUE_CHAR_HR(ERROR_LAST_ADMIN                 ),
     VALUE_CHAR_HR(ERROR_WRONG_PASSWORD             ),
     VALUE_CHAR_HR(ERROR_ILL_FORMED_PASSWORD        ),
     VALUE_CHAR_HR(ERROR_PASSWORD_RESTRICTION       ),
     VALUE_CHAR_HR(ERROR_LOGON_FAILURE              ),
     VALUE_CHAR_HR(ERROR_ACCOUNT_RESTRICTION        ),
     VALUE_CHAR_HR(ERROR_INVALID_LOGON_HOURS        ),
     VALUE_CHAR_HR(ERROR_INVALID_WORKSTATION        ),
     VALUE_CHAR_HR(ERROR_PASSWORD_EXPIRED           ),
     VALUE_CHAR_HR(ERROR_ACCOUNT_DISABLED           ),
     VALUE_CHAR_HR(ERROR_NONE_MAPPED                ),
     VALUE_CHAR_HR(ERROR_TOO_MANY_LUIDS_REQUESTED   ),
     VALUE_CHAR_HR(ERROR_LUIDS_EXHAUSTED            ),
     VALUE_CHAR_HR(ERROR_INVALID_SUB_AUTHORITY      ),
     VALUE_CHAR_HR(ERROR_INVALID_ACL                ),
     VALUE_CHAR_HR(ERROR_INVALID_SID                ),
     VALUE_CHAR_HR(ERROR_INVALID_SECURITY_DESCR     ),
     VALUE_CHAR_HR(ERROR_BAD_INHERITANCE_ACL        ),
     VALUE_CHAR_HR(ERROR_SERVER_DISABLED            ),
     VALUE_CHAR_HR(ERROR_SERVER_NOT_DISABLED        ),
     VALUE_CHAR_HR(ERROR_INVALID_ID_AUTHORITY       ),
     VALUE_CHAR_HR(ERROR_ALLOTTED_SPACE_EXCEEDED    ),
     VALUE_CHAR_HR(ERROR_INVALID_GROUP_ATTRIBUTES   ),
     VALUE_CHAR_HR(ERROR_BAD_IMPERSONATION_LEVEL    ),
     VALUE_CHAR_HR(ERROR_CANT_OPEN_ANONYMOUS        ),
     VALUE_CHAR_HR(ERROR_BAD_VALIDATION_CLASS       ),
     VALUE_CHAR_HR(ERROR_BAD_TOKEN_TYPE             ),
     VALUE_CHAR_HR(ERROR_NO_SECURITY_ON_OBJECT      ),
     VALUE_CHAR_HR(ERROR_CANT_ACCESS_DOMAIN_INFO    ),
     VALUE_CHAR_HR(ERROR_INVALID_SERVER_STATE       ),
     VALUE_CHAR_HR(ERROR_INVALID_DOMAIN_STATE       ),
     VALUE_CHAR_HR(ERROR_INVALID_DOMAIN_ROLE        ),
     VALUE_CHAR_HR(ERROR_NO_SUCH_DOMAIN             ),
     VALUE_CHAR_HR(ERROR_DOMAIN_EXISTS              ),
     VALUE_CHAR_HR(ERROR_DOMAIN_LIMIT_EXCEEDED      ),
     VALUE_CHAR_HR(ERROR_INTERNAL_DB_CORRUPTION     ),
     VALUE_CHAR_HR(ERROR_INTERNAL_ERROR             ),
     VALUE_CHAR_HR(ERROR_GENERIC_NOT_MAPPED         ),
     VALUE_CHAR_HR(ERROR_BAD_DESCRIPTOR_FORMAT      ),
     VALUE_CHAR_HR(ERROR_NOT_LOGON_PROCESS          ),
     VALUE_CHAR_HR(ERROR_LOGON_SESSION_EXISTS       ),
     VALUE_CHAR_HR(ERROR_NO_SUCH_PACKAGE            ),
     VALUE_CHAR_HR(ERROR_BAD_LOGON_SESSION_STATE    ),
     VALUE_CHAR_HR(ERROR_LOGON_SESSION_COLLISION    ),
     VALUE_CHAR_HR(ERROR_INVALID_LOGON_TYPE         ),
     VALUE_CHAR_HR(ERROR_CANNOT_IMPERSONATE         ),
     VALUE_CHAR_HR(ERROR_RXACT_INVALID_STATE        ),
     VALUE_CHAR_HR(ERROR_RXACT_COMMIT_FAILURE       ),
     VALUE_CHAR_HR(ERROR_SPECIAL_ACCOUNT            ),
     VALUE_CHAR_HR(ERROR_SPECIAL_GROUP              ),
     VALUE_CHAR_HR(ERROR_SPECIAL_USER               ),
     VALUE_CHAR_HR(ERROR_MEMBERS_PRIMARY_GROUP      ),
     VALUE_CHAR_HR(ERROR_TOKEN_ALREADY_IN_USE       ),
     VALUE_CHAR_HR(ERROR_NO_SUCH_ALIAS              ),
     VALUE_CHAR_HR(ERROR_MEMBER_NOT_IN_ALIAS        ),
     VALUE_CHAR_HR(ERROR_MEMBER_IN_ALIAS            ),
     VALUE_CHAR_HR(ERROR_ALIAS_EXISTS               ),
     VALUE_CHAR_HR(ERROR_LOGON_NOT_GRANTED          ),
     VALUE_CHAR_HR(ERROR_TOO_MANY_SECRETS           ),
     VALUE_CHAR_HR(ERROR_SECRET_TOO_LONG            ),
     VALUE_CHAR_HR(ERROR_INTERNAL_DB_ERROR          ),
     VALUE_CHAR_HR(ERROR_TOO_MANY_CONTEXT_IDS       ),
     VALUE_CHAR_HR(ERROR_LOGON_TYPE_NOT_GRANTED     ),
     VALUE_CHAR_HR(ERROR_NT_CROSS_ENCRYPTION_REQUIRED ),
     VALUE_CHAR_HR(ERROR_NO_SUCH_MEMBER             ),
     VALUE_CHAR_HR(ERROR_INVALID_MEMBER             ),
     VALUE_CHAR_HR(ERROR_TOO_MANY_SIDS              ),
     VALUE_CHAR_HR(ERROR_LM_CROSS_ENCRYPTION_REQUIRED ),
     VALUE_CHAR_HR(ERROR_NO_INHERITANCE             ),
     VALUE_CHAR_HR(ERROR_FILE_CORRUPT               ),
     VALUE_CHAR_HR(ERROR_DISK_CORRUPT               ),
     VALUE_CHAR_HR(ERROR_NO_USER_SESSION_KEY        ),
     VALUE_CHAR_HR(ERROR_LICENSE_QUOTA_EXCEEDED     ),
     VALUE_CHAR_HR(ERROR_INVALID_WINDOW_HANDLE      ),
     VALUE_CHAR_HR(ERROR_INVALID_MENU_HANDLE        ),
     VALUE_CHAR_HR(ERROR_INVALID_CURSOR_HANDLE      ),
     VALUE_CHAR_HR(ERROR_INVALID_ACCEL_HANDLE       ),
     VALUE_CHAR_HR(ERROR_INVALID_HOOK_HANDLE        ),
     VALUE_CHAR_HR(ERROR_INVALID_DWP_HANDLE         ),
     VALUE_CHAR_HR(ERROR_TLW_WITH_WSCHILD           ),
     VALUE_CHAR_HR(ERROR_CANNOT_FIND_WND_CLASS      ),
     VALUE_CHAR_HR(ERROR_WINDOW_OF_OTHER_THREAD     ),
     VALUE_CHAR_HR(ERROR_HOTKEY_ALREADY_REGISTERED  ),
     VALUE_CHAR_HR(ERROR_CLASS_ALREADY_EXISTS       ),
     VALUE_CHAR_HR(ERROR_CLASS_DOES_NOT_EXIST       ),
     VALUE_CHAR_HR(ERROR_CLASS_HAS_WINDOWS          ),
     VALUE_CHAR_HR(ERROR_INVALID_INDEX              ),
     VALUE_CHAR_HR(ERROR_INVALID_ICON_HANDLE        ),
     VALUE_CHAR_HR(ERROR_PRIVATE_DIALOG_INDEX       ),
     VALUE_CHAR_HR(ERROR_LISTBOX_ID_NOT_FOUND       ),
     VALUE_CHAR_HR(ERROR_NO_WILDCARD_CHARACTERS     ),
     VALUE_CHAR_HR(ERROR_CLIPBOARD_NOT_OPEN         ),
     VALUE_CHAR_HR(ERROR_HOTKEY_NOT_REGISTERED      ),
     VALUE_CHAR_HR(ERROR_WINDOW_NOT_DIALOG          ),
     VALUE_CHAR_HR(ERROR_CONTROL_ID_NOT_FOUND       ),
     VALUE_CHAR_HR(ERROR_INVALID_COMBOBOX_MESSAGE   ),
     VALUE_CHAR_HR(ERROR_WINDOW_NOT_COMBOBOX        ),
     VALUE_CHAR_HR(ERROR_INVALID_EDIT_HEIGHT        ),
     VALUE_CHAR_HR(ERROR_DC_NOT_FOUND               ),
     VALUE_CHAR_HR(ERROR_INVALID_HOOK_FILTER        ),
     VALUE_CHAR_HR(ERROR_INVALID_FILTER_PROC        ),
     VALUE_CHAR_HR(ERROR_HOOK_NEEDS_HMOD            ),
     VALUE_CHAR_HR(ERROR_GLOBAL_ONLY_HOOK           ),
     VALUE_CHAR_HR(ERROR_JOURNAL_HOOK_SET           ),
     VALUE_CHAR_HR(ERROR_HOOK_NOT_INSTALLED         ),
     VALUE_CHAR_HR(ERROR_INVALID_LB_MESSAGE         ),
     VALUE_CHAR_HR(ERROR_SETCOUNT_ON_BAD_LB         ),
     VALUE_CHAR_HR(ERROR_LB_WITHOUT_TABSTOPS        ),
     VALUE_CHAR_HR(ERROR_DESTROY_OBJECT_OF_OTHER_THREAD ),
     VALUE_CHAR_HR(ERROR_CHILD_WINDOW_MENU          ),
     VALUE_CHAR_HR(ERROR_NO_SYSTEM_MENU             ),
     VALUE_CHAR_HR(ERROR_INVALID_MSGBOX_STYLE       ),
     VALUE_CHAR_HR(ERROR_INVALID_SPI_VALUE          ),
     VALUE_CHAR_HR(ERROR_SCREEN_ALREADY_LOCKED      ),
     VALUE_CHAR_HR(ERROR_HWNDS_HAVE_DIFF_PARENT     ),
     VALUE_CHAR_HR(ERROR_NOT_CHILD_WINDOW           ),
     VALUE_CHAR_HR(ERROR_INVALID_GW_COMMAND         ),
     VALUE_CHAR_HR(ERROR_INVALID_THREAD_ID          ),
     VALUE_CHAR_HR(ERROR_NON_MDICHILD_WINDOW        ),
     VALUE_CHAR_HR(ERROR_POPUP_ALREADY_ACTIVE       ),
     VALUE_CHAR_HR(ERROR_NO_SCROLLBARS              ),
     VALUE_CHAR_HR(ERROR_INVALID_SCROLLBAR_RANGE    ),
     VALUE_CHAR_HR(ERROR_INVALID_SHOWWIN_COMMAND    ),
     VALUE_CHAR_HR(ERROR_NO_SYSTEM_RESOURCES        ),
     VALUE_CHAR_HR(ERROR_NONPAGED_SYSTEM_RESOURCES  ),
     VALUE_CHAR_HR(ERROR_PAGED_SYSTEM_RESOURCES     ),
     VALUE_CHAR_HR(ERROR_WORKING_SET_QUOTA          ),
     VALUE_CHAR_HR(ERROR_PAGEFILE_QUOTA             ),
     VALUE_CHAR_HR(ERROR_COMMITMENT_LIMIT           ),
     VALUE_CHAR_HR(ERROR_MENU_ITEM_NOT_FOUND        ),
     VALUE_CHAR_HR(ERROR_INVALID_KEYBOARD_HANDLE    ),
     VALUE_CHAR_HR(ERROR_HOOK_TYPE_NOT_ALLOWED      ),
     VALUE_CHAR_HR(ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION ),
     VALUE_CHAR_HR(ERROR_TIMEOUT                    ),
     VALUE_CHAR_HR(ERROR_EVENTLOG_FILE_CORRUPT      ),
     VALUE_CHAR_HR(ERROR_EVENTLOG_CANT_START        ),
     VALUE_CHAR_HR(ERROR_LOG_FILE_FULL              ),
     VALUE_CHAR_HR(ERROR_EVENTLOG_FILE_CHANGED      ),


     VALUE_CHAR_HR(RPC_S_INVALID_STRING_BINDING     ),
     VALUE_CHAR_HR(RPC_S_WRONG_KIND_OF_BINDING      ),
     VALUE_CHAR_HR(RPC_S_INVALID_BINDING            ),
     VALUE_CHAR_HR(RPC_S_PROTSEQ_NOT_SUPPORTED      ),
     VALUE_CHAR_HR(RPC_S_INVALID_RPC_PROTSEQ        ),
     VALUE_CHAR_HR(RPC_S_INVALID_STRING_UUID        ),
     VALUE_CHAR_HR(RPC_S_INVALID_ENDPOINT_FORMAT    ),
     VALUE_CHAR_HR(RPC_S_INVALID_NET_ADDR           ),
     VALUE_CHAR_HR(RPC_S_NO_ENDPOINT_FOUND          ),
     VALUE_CHAR_HR(RPC_S_INVALID_TIMEOUT            ),
     VALUE_CHAR_HR(RPC_S_OBJECT_NOT_FOUND           ),
     VALUE_CHAR_HR(RPC_S_ALREADY_REGISTERED         ),
     VALUE_CHAR_HR(RPC_S_TYPE_ALREADY_REGISTERED    ),
     VALUE_CHAR_HR(RPC_S_ALREADY_LISTENING          ),
     VALUE_CHAR_HR(RPC_S_NO_PROTSEQS_REGISTERED     ),
     VALUE_CHAR_HR(RPC_S_NOT_LISTENING              ),
     VALUE_CHAR_HR(RPC_S_UNKNOWN_MGR_TYPE           ),
     VALUE_CHAR_HR(RPC_S_UNKNOWN_IF                 ),
     VALUE_CHAR_HR(RPC_S_NO_BINDINGS                ),
     VALUE_CHAR_HR(RPC_S_NO_PROTSEQS                ),
     VALUE_CHAR_HR(RPC_S_CANT_CREATE_ENDPOINT       ),
     VALUE_CHAR_HR(RPC_S_OUT_OF_RESOURCES           ),
     VALUE_CHAR_HR(RPC_S_SERVER_UNAVAILABLE         ),
     VALUE_CHAR_HR(RPC_S_SERVER_TOO_BUSY            ),
     VALUE_CHAR_HR(RPC_S_INVALID_NETWORK_OPTIONS    ),
     VALUE_CHAR_HR(RPC_S_NO_CALL_ACTIVE             ),
     VALUE_CHAR_HR(RPC_S_CALL_FAILED                ),
     VALUE_CHAR_HR(RPC_S_CALL_FAILED_DNE            ),
     VALUE_CHAR_HR(RPC_S_PROTOCOL_ERROR             ),
     VALUE_CHAR_HR(RPC_S_UNSUPPORTED_TRANS_SYN      ),
     VALUE_CHAR_HR(RPC_S_UNSUPPORTED_TYPE           ),
     VALUE_CHAR_HR(RPC_S_INVALID_TAG                ),
     VALUE_CHAR_HR(RPC_S_INVALID_BOUND              ),
     VALUE_CHAR_HR(RPC_S_NO_ENTRY_NAME              ),
     VALUE_CHAR_HR(RPC_S_INVALID_NAME_SYNTAX        ),
     VALUE_CHAR_HR(RPC_S_UNSUPPORTED_NAME_SYNTAX    ),
     VALUE_CHAR_HR(RPC_S_UUID_NO_ADDRESS            ),
     VALUE_CHAR_HR(RPC_S_DUPLICATE_ENDPOINT         ),
     VALUE_CHAR_HR(RPC_S_UNKNOWN_AUTHN_TYPE         ),
     VALUE_CHAR_HR(RPC_S_MAX_CALLS_TOO_SMALL        ),
     VALUE_CHAR_HR(RPC_S_STRING_TOO_LONG            ),
     VALUE_CHAR_HR(RPC_S_PROTSEQ_NOT_FOUND          ),
     VALUE_CHAR_HR(RPC_S_PROCNUM_OUT_OF_RANGE       ),
     VALUE_CHAR_HR(RPC_S_BINDING_HAS_NO_AUTH        ),
     VALUE_CHAR_HR(RPC_S_UNKNOWN_AUTHN_SERVICE      ),
     VALUE_CHAR_HR(RPC_S_UNKNOWN_AUTHN_LEVEL        ),
     VALUE_CHAR_HR(RPC_S_INVALID_AUTH_IDENTITY      ),
     VALUE_CHAR_HR(RPC_S_UNKNOWN_AUTHZ_SERVICE      ),
     VALUE_CHAR_HR(EPT_S_INVALID_ENTRY              ),
     VALUE_CHAR_HR(EPT_S_CANT_PERFORM_OP            ),
     VALUE_CHAR_HR(EPT_S_NOT_REGISTERED             ),
     VALUE_CHAR_HR(RPC_S_NOTHING_TO_EXPORT          ),
     VALUE_CHAR_HR(RPC_S_INCOMPLETE_NAME            ),
     VALUE_CHAR_HR(RPC_S_INVALID_VERS_OPTION        ),
     VALUE_CHAR_HR(RPC_S_NO_MORE_MEMBERS            ),
     VALUE_CHAR_HR(RPC_S_NOT_ALL_OBJS_UNEXPORTED    ),
     VALUE_CHAR_HR(RPC_S_INTERFACE_NOT_FOUND        ),
     VALUE_CHAR_HR(RPC_S_ENTRY_ALREADY_EXISTS       ),
     VALUE_CHAR_HR(RPC_S_ENTRY_NOT_FOUND            ),
     VALUE_CHAR_HR(RPC_S_NAME_SERVICE_UNAVAILABLE   ),
     VALUE_CHAR_HR(RPC_S_INVALID_NAF_ID             ),
     VALUE_CHAR_HR(RPC_S_CANNOT_SUPPORT             ),
     VALUE_CHAR_HR(RPC_S_NO_CONTEXT_AVAILABLE       ),
     VALUE_CHAR_HR(RPC_S_INTERNAL_ERROR             ),
     VALUE_CHAR_HR(RPC_S_ZERO_DIVIDE                ),
     VALUE_CHAR_HR(RPC_S_ADDRESS_ERROR              ),
     VALUE_CHAR_HR(RPC_S_FP_DIV_ZERO                ),
     VALUE_CHAR_HR(RPC_S_FP_UNDERFLOW               ),
     VALUE_CHAR_HR(RPC_S_FP_OVERFLOW                ),
     VALUE_CHAR_HR(RPC_X_NO_MORE_ENTRIES            ),
     VALUE_CHAR_HR(RPC_X_SS_CHAR_TRANS_OPEN_FAIL    ),
     VALUE_CHAR_HR(RPC_X_SS_CHAR_TRANS_SHORT_FILE   ),
     VALUE_CHAR_HR(RPC_X_SS_IN_NULL_CONTEXT         ),
     VALUE_CHAR_HR(RPC_X_SS_CONTEXT_DAMAGED         ),
     VALUE_CHAR_HR(RPC_X_SS_HANDLES_MISMATCH        ),
     VALUE_CHAR_HR(RPC_X_SS_CANNOT_GET_CALL_HANDLE  ),
     VALUE_CHAR_HR(RPC_X_NULL_REF_POINTER           ),
     VALUE_CHAR_HR(RPC_X_ENUM_VALUE_OUT_OF_RANGE    ),
     VALUE_CHAR_HR(RPC_X_BYTE_COUNT_TOO_SMALL       ),
     VALUE_CHAR_HR(RPC_X_BAD_STUB_DATA              ),

     VALUE_CHAR_HR(ERROR_INVALID_USER_BUFFER        ),
     VALUE_CHAR_HR(ERROR_UNRECOGNIZED_MEDIA         ),
     VALUE_CHAR_HR(ERROR_NO_TRUST_LSA_SECRET        ),
     VALUE_CHAR_HR(ERROR_NO_TRUST_SAM_ACCOUNT       ),
     VALUE_CHAR_HR(ERROR_TRUSTED_DOMAIN_FAILURE     ),
     VALUE_CHAR_HR(ERROR_TRUSTED_RELATIONSHIP_FAILURE ),
     VALUE_CHAR_HR(ERROR_TRUST_FAILURE              ),
     VALUE_CHAR_HR(RPC_S_CALL_IN_PROGRESS           ),
     VALUE_CHAR_HR(ERROR_NETLOGON_NOT_STARTED       ),
     VALUE_CHAR_HR(ERROR_ACCOUNT_EXPIRED            ),
     VALUE_CHAR_HR(ERROR_REDIRECTOR_HAS_OPEN_HANDLES ),
     VALUE_CHAR_HR(ERROR_PRINTER_DRIVER_ALREADY_INSTALLED ),
     VALUE_CHAR_HR(ERROR_UNKNOWN_PORT               ),
     VALUE_CHAR_HR(ERROR_UNKNOWN_PRINTER_DRIVER     ),
     VALUE_CHAR_HR(ERROR_UNKNOWN_PRINTPROCESSOR     ),
     VALUE_CHAR_HR(ERROR_INVALID_SEPARATOR_FILE     ),
     VALUE_CHAR_HR(ERROR_INVALID_PRIORITY           ),
     VALUE_CHAR_HR(ERROR_INVALID_PRINTER_NAME       ),
     VALUE_CHAR_HR(ERROR_PRINTER_ALREADY_EXISTS     ),
     VALUE_CHAR_HR(ERROR_INVALID_PRINTER_COMMAND    ),
     VALUE_CHAR_HR(ERROR_INVALID_DATATYPE           ),
     VALUE_CHAR_HR(ERROR_INVALID_ENVIRONMENT        ),
     VALUE_CHAR_HR(RPC_S_NO_MORE_BINDINGS           ),
     VALUE_CHAR_HR(ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT ),
     VALUE_CHAR_HR(ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT ),
     VALUE_CHAR_HR(ERROR_NOLOGON_SERVER_TRUST_ACCOUNT ),
     VALUE_CHAR_HR(ERROR_DOMAIN_TRUST_INCONSISTENT  ),
     VALUE_CHAR_HR(ERROR_SERVER_HAS_OPEN_HANDLES    ),
     VALUE_CHAR_HR(ERROR_RESOURCE_DATA_NOT_FOUND    ),
     VALUE_CHAR_HR(ERROR_RESOURCE_TYPE_NOT_FOUND    ),
     VALUE_CHAR_HR(ERROR_RESOURCE_NAME_NOT_FOUND    ),
     VALUE_CHAR_HR(ERROR_RESOURCE_LANG_NOT_FOUND    ),
     VALUE_CHAR_HR(ERROR_NOT_ENOUGH_QUOTA           ),
     VALUE_CHAR_HR(RPC_S_NO_INTERFACES              ),
     VALUE_CHAR_HR(RPC_S_CALL_CANCELLED             ),
     VALUE_CHAR_HR(RPC_S_BINDING_INCOMPLETE         ),
     VALUE_CHAR_HR(RPC_S_COMM_FAILURE               ),
     VALUE_CHAR_HR(RPC_S_UNSUPPORTED_AUTHN_LEVEL    ),
     VALUE_CHAR_HR(RPC_S_NO_PRINC_NAME              ),
     VALUE_CHAR_HR(RPC_S_NOT_RPC_ERROR              ),
     VALUE_CHAR_HR(RPC_S_UUID_LOCAL_ONLY            ),
     VALUE_CHAR_HR(RPC_S_SEC_PKG_ERROR              ),
     VALUE_CHAR_HR(RPC_S_NOT_CANCELLED              ),
     VALUE_CHAR_HR(RPC_X_INVALID_ES_ACTION          ),
     VALUE_CHAR_HR(RPC_X_WRONG_ES_VERSION           ),
     VALUE_CHAR_HR(RPC_X_WRONG_STUB_VERSION         ),
     VALUE_CHAR_HR(RPC_X_INVALID_PIPE_OBJECT        ),
     VALUE_CHAR_HR(RPC_X_INVALID_PIPE_OPERATION     ),
     VALUE_CHAR_HR(RPC_X_WRONG_PIPE_VERSION         ),
     VALUE_CHAR_HR(RPC_S_GROUP_MEMBER_NOT_FOUND     ),
     VALUE_CHAR_HR(EPT_S_CANT_CREATE                ),
     VALUE_CHAR_HR(RPC_S_INVALID_OBJECT             ),
     VALUE_CHAR_HR(ERROR_INVALID_TIME               ),
     VALUE_CHAR_HR(ERROR_INVALID_FORM_NAME          ),
     VALUE_CHAR_HR(ERROR_INVALID_FORM_SIZE          ),
     VALUE_CHAR_HR(ERROR_ALREADY_WAITING            ),
     VALUE_CHAR_HR(ERROR_PRINTER_DELETED            ),
     VALUE_CHAR_HR(ERROR_INVALID_PRINTER_STATE      ),
     VALUE_CHAR_HR(ERROR_PASSWORD_MUST_CHANGE       ),
     VALUE_CHAR_HR(ERROR_DOMAIN_CONTROLLER_NOT_FOUND ),
     VALUE_CHAR_HR(ERROR_ACCOUNT_LOCKED_OUT         ),
     VALUE_CHAR_HR(OR_INVALID_OXID                  ),
     VALUE_CHAR_HR(OR_INVALID_OID                   ),
     VALUE_CHAR_HR(OR_INVALID_SET                   ),
     VALUE_CHAR_HR(RPC_S_SEND_INCOMPLETE            ),
     VALUE_CHAR_HR(ERROR_NO_BROWSER_SERVERS_FOUND   ),

     VALUE_CHAR_HR(ERROR_INVALID_PIXEL_FORMAT       ),
     VALUE_CHAR_HR(ERROR_BAD_DRIVER                 ),
     VALUE_CHAR_HR(ERROR_INVALID_WINDOW_STYLE       ),
     VALUE_CHAR_HR(ERROR_METAFILE_NOT_SUPPORTED     ),
     VALUE_CHAR_HR(ERROR_TRANSFORM_NOT_SUPPORTED    ),
     VALUE_CHAR_HR(ERROR_CLIPPING_NOT_SUPPORTED     ),
     VALUE_CHAR_HR(ERROR_UNKNOWN_PRINT_MONITOR      ),
     VALUE_CHAR_HR(ERROR_PRINTER_DRIVER_IN_USE      ),
     VALUE_CHAR_HR(ERROR_SPOOL_FILE_NOT_FOUND       ),
     VALUE_CHAR_HR(ERROR_SPL_NO_STARTDOC            ),
     VALUE_CHAR_HR(ERROR_SPL_NO_ADDJOB              ),
     VALUE_CHAR_HR(ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED ),
     VALUE_CHAR_HR(ERROR_PRINT_MONITOR_ALREADY_INSTALLED ),
     VALUE_CHAR_HR(ERROR_INVALID_PRINT_MONITOR      ),
     VALUE_CHAR_HR(ERROR_PRINT_MONITOR_IN_USE       ),
     VALUE_CHAR_HR(ERROR_PRINTER_HAS_JOBS_QUEUED    ),
     VALUE_CHAR_HR(ERROR_SUCCESS_REBOOT_REQUIRED    ),
     VALUE_CHAR_HR(ERROR_SUCCESS_RESTART_REQUIRED   ),
     VALUE_CHAR_HR(ERROR_WINS_INTERNAL              ),
     VALUE_CHAR_HR(ERROR_CAN_NOT_DEL_LOCAL_WINS     ),
     VALUE_CHAR_HR(ERROR_STATIC_INIT                ),
     VALUE_CHAR_HR(ERROR_INC_BACKUP                 ),
     VALUE_CHAR_HR(ERROR_FULL_BACKUP                ),
     VALUE_CHAR_HR(ERROR_REC_NON_EXISTENT           ),
     VALUE_CHAR_HR(ERROR_RPL_NOT_ALLOWED            ),

     VALUE_CHAR(CO_E_INIT_SHARED_ALLOCATOR       ),
     VALUE_CHAR(CO_E_INIT_MEMORY_ALLOCATOR       ),
     VALUE_CHAR(CO_E_INIT_CLASS_CACHE            ),
     VALUE_CHAR(CO_E_INIT_RPC_CHANNEL            ),
     VALUE_CHAR(OLE_E_OLEVERB                    ),
     VALUE_CHAR(OLE_E_ADVF                       ),
     VALUE_CHAR(OLE_E_ENUM_NOMORE                ),
     VALUE_CHAR(OLE_E_ADVISENOTSUPPORTED         ),
     VALUE_CHAR(OLE_E_NOCONNECTION               ),
     VALUE_CHAR(OLE_E_NOTRUNNING                 ),
     VALUE_CHAR(OLE_E_NOCACHE                    ),
     VALUE_CHAR(OLE_E_BLANK                      ),
     VALUE_CHAR(OLE_E_CLASSDIFF                  ),
     VALUE_CHAR(OLE_E_CANT_GETMONIKER            ),
     VALUE_CHAR(OLE_E_CANT_BINDTOSOURCE          ),
     VALUE_CHAR(OLE_E_STATIC                     ),
     VALUE_CHAR(OLE_E_PROMPTSAVECANCELLED        ),
     VALUE_CHAR(OLE_E_INVALIDRECT                ),
     VALUE_CHAR(OLE_E_WRONGCOMPOBJ               ),
     VALUE_CHAR(OLE_E_INVALIDHWND                ),
     VALUE_CHAR(OLE_E_NOT_INPLACEACTIVE          ),
     VALUE_CHAR(OLE_E_CANTCONVERT                ),
     VALUE_CHAR(OLE_E_NOSTORAGE                  ),
     VALUE_CHAR(DRAGDROP_E_NOTREGISTERED         ),
     VALUE_CHAR(DRAGDROP_E_ALREADYREGISTERED     ),
     VALUE_CHAR(DRAGDROP_E_INVALIDHWND           ),
     VALUE_CHAR(CLASS_E_CLASSNOTAVAILABLE        ),
     VALUE_CHAR(REGDB_E_READREGDB                ),
     VALUE_CHAR(REGDB_E_WRITEREGDB               ),
     VALUE_CHAR(REGDB_E_KEYMISSING               ),
     VALUE_CHAR(REGDB_E_INVALIDVALUE             ),
     VALUE_CHAR(REGDB_E_IIDNOTREG                ),
     VALUE_CHAR(CACHE_E_NOCACHE_UPDATED          ),
     VALUE_CHAR(OLEOBJ_E_NOVERBS                 ),
     VALUE_CHAR(OLEOBJ_E_INVALIDVERB             ),
     VALUE_CHAR(CLIPBRD_E_CANT_OPEN              ),
     VALUE_CHAR(CLIPBRD_E_CANT_EMPTY             ),
     VALUE_CHAR(CLIPBRD_E_CANT_SET               ),
     VALUE_CHAR(CLIPBRD_E_BAD_DATA               ),
     VALUE_CHAR(CLIPBRD_E_CANT_CLOSE             ),
     VALUE_CHAR(OLE_S_USEREG                     ),
     VALUE_CHAR(OLE_S_STATIC                     ),
     VALUE_CHAR(DRAGDROP_S_DROP                  ),
     VALUE_CHAR(DRAGDROP_S_CANCEL                ),
     VALUE_CHAR(DRAGDROP_S_USEDEFAULTCURSORS     ),
     VALUE_CHAR(MK_S_REDUCED_TO_SELF             ),
     VALUE_CHAR(MK_S_ME                          ),
     VALUE_CHAR(MK_S_HIM                         ),
     VALUE_CHAR(MK_S_US                          ),
     VALUE_CHAR(MK_S_MONIKERALREADYREGISTERED    ),
     VALUE_CHAR(CO_E_CLASS_CREATE_FAILED         ),
     VALUE_CHAR(CO_E_SCM_ERROR                   ),
     VALUE_CHAR(CO_E_SCM_RPC_FAILURE             ),
     VALUE_CHAR(CO_E_BAD_PATH                    ),
     VALUE_CHAR(CO_E_SERVER_EXEC_FAILURE         ),
     VALUE_CHAR(CO_E_OBJSRV_RPC_FAILURE          ),
     VALUE_CHAR(MK_E_NO_NORMALIZED               ),
     VALUE_CHAR(CO_E_SERVER_STOPPING             ),
     VALUE_CHAR(MEM_E_INVALID_ROOT               ),
     VALUE_CHAR(MEM_E_INVALID_LINK               ),
     VALUE_CHAR(MEM_E_INVALID_SIZE               ),

     VALUE_CHAR(TYPE_E_BUFFERTOOSMALL            ),
     VALUE_CHAR(TYPE_E_INVDATAREAD               ),
     VALUE_CHAR(TYPE_E_UNSUPFORMAT               ),
     VALUE_CHAR(TYPE_E_REGISTRYACCESS            ),
     VALUE_CHAR(TYPE_E_LIBNOTREGISTERED          ),
     VALUE_CHAR(TYPE_E_UNDEFINEDTYPE             ),
     VALUE_CHAR(TYPE_E_QUALIFIEDNAMEDISALLOWED   ),
     VALUE_CHAR(TYPE_E_INVALIDSTATE              ),
     VALUE_CHAR(TYPE_E_WRONGTYPEKIND             ),
     VALUE_CHAR(TYPE_E_ELEMENTNOTFOUND           ),
     VALUE_CHAR(TYPE_E_AMBIGUOUSNAME             ),
     VALUE_CHAR(TYPE_E_NAMECONFLICT              ),
     VALUE_CHAR(TYPE_E_UNKNOWNLCID               ),
     VALUE_CHAR(TYPE_E_DLLFUNCTIONNOTFOUND       ),
     VALUE_CHAR(TYPE_E_BADMODULEKIND             ),
     VALUE_CHAR(TYPE_E_SIZETOOBIG                ),
     VALUE_CHAR(TYPE_E_DUPLICATEID               ),
     VALUE_CHAR(TYPE_E_INVALIDID                 ),
     VALUE_CHAR(TYPE_E_TYPEMISMATCH              ),
     VALUE_CHAR(TYPE_E_OUTOFBOUNDS               ),
     VALUE_CHAR(TYPE_E_IOERROR                   ),
     VALUE_CHAR(TYPE_E_CANTCREATETMPFILE         ),
     VALUE_CHAR(TYPE_E_CANTLOADLIBRARY           ),
     VALUE_CHAR(TYPE_E_INCONSISTENTPROPFUNCS     ),
     VALUE_CHAR(TYPE_E_CIRCULARTYPE              ),
     VALUE_CHAR(RPC_E_CALL_REJECTED              ),
     VALUE_CHAR(RPC_E_CALL_CANCELED              ),
     VALUE_CHAR(RPC_E_CANTPOST_INSENDCALL        ),
     VALUE_CHAR(RPC_E_CANTCALLOUT_INASYNCCALL    ),
     VALUE_CHAR(RPC_E_CANTCALLOUT_INEXTERNALCALL ),
     VALUE_CHAR(RPC_E_CONNECTION_TERMINATED      ),
     VALUE_CHAR(RPC_E_SERVER_DIED                ),
     VALUE_CHAR(RPC_E_CLIENT_DIED                ),
     VALUE_CHAR(RPC_E_INVALID_DATAPACKET         ),
     VALUE_CHAR(RPC_E_CANTTRANSMIT_CALL          ),
     VALUE_CHAR(RPC_E_CLIENT_CANTMARSHAL_DATA    ),
     VALUE_CHAR(RPC_E_CLIENT_CANTUNMARSHAL_DATA  ),
     VALUE_CHAR(RPC_E_SERVER_CANTMARSHAL_DATA    ),
     VALUE_CHAR(RPC_E_SERVER_CANTUNMARSHAL_DATA  ),
     VALUE_CHAR(RPC_E_INVALID_DATA               ),
     VALUE_CHAR(RPC_E_INVALID_PARAMETER          ),
     VALUE_CHAR(RPC_E_CANTCALLOUT_AGAIN          ),
     VALUE_CHAR(RPC_E_SERVER_DIED_DNE            ),
     VALUE_CHAR(RPC_E_SYS_CALL_FAILED            ),
     VALUE_CHAR(RPC_E_OUT_OF_RESOURCES           ),
     VALUE_CHAR(RPC_E_ATTEMPTED_MULTITHREAD      ),
     VALUE_CHAR(RPC_E_NOT_REGISTERED             ),
     VALUE_CHAR(RPC_E_FAULT                      ),
     VALUE_CHAR(RPC_E_SERVERFAULT                ),
     VALUE_CHAR(RPC_E_CHANGED_MODE               ),
     VALUE_CHAR(RPC_E_INVALIDMETHOD              ),
     VALUE_CHAR(RPC_E_DISCONNECTED               ),
     VALUE_CHAR(RPC_E_RETRY                      ),
     VALUE_CHAR(RPC_E_SERVERCALL_RETRYLATER      ),
     VALUE_CHAR(RPC_E_SERVERCALL_REJECTED        ),
     VALUE_CHAR(RPC_E_INVALID_CALLDATA           ),
     VALUE_CHAR(RPC_E_CANTCALLOUT_ININPUTSYNCCALL ),
     VALUE_CHAR(RPC_E_WRONG_THREAD               ),
     VALUE_CHAR(RPC_E_THREAD_NOT_INIT            ),
     VALUE_CHAR(RPC_E_VERSION_MISMATCH           ),
     VALUE_CHAR(RPC_E_INVALID_HEADER             ),
     VALUE_CHAR(RPC_E_INVALID_EXTENSION          ),
     VALUE_CHAR(RPC_E_INVALID_IPID               ),
     VALUE_CHAR(RPC_E_INVALID_OBJECT             ),
     VALUE_CHAR(RPC_S_CALLPENDING                ),
     VALUE_CHAR(RPC_S_WAITONTIMER                ),
     VALUE_CHAR(RPC_E_CALL_COMPLETE              ),
     VALUE_CHAR(RPC_E_UNSECURE_CALL              ),
     VALUE_CHAR(RPC_E_TOO_LATE                   ),
     VALUE_CHAR(RPC_E_NO_GOOD_SECURITY_PACKAGES  ),
     VALUE_CHAR(RPC_E_ACCESS_DENIED              ),
     VALUE_CHAR(RPC_E_REMOTE_DISABLED            ),
     VALUE_CHAR(RPC_E_INVALID_OBJREF             ),
     VALUE_CHAR(RPC_E_UNEXPECTED                 ),
     VALUE_CHAR(TRUST_E_PROVIDER_UNKNOWN         ),
     VALUE_CHAR(TRUST_E_ACTION_UNKNOWN           ),
     VALUE_CHAR(TRUST_E_SUBJECT_FORM_UNKNOWN     ),
     VALUE_CHAR(TRUST_E_SUBJECT_NOT_TRUSTED      ),
     VALUE_CHAR(PERSIST_E_SIZEDEFINITE           ),
     VALUE_CHAR(PERSIST_E_SIZEINDEFINITE         ),
     VALUE_CHAR(PERSIST_E_NOTSELFSIZING          ),
     VALUE_CHAR(TRUST_E_NOSIGNATURE              ),
     VALUE_CHAR(CERT_E_EXPIRED                   ),
     VALUE_CHAR(CERT_E_ROLE                      ),
     VALUE_CHAR(CERT_E_PATHLENCONST              ),
     VALUE_CHAR(CERT_E_CRITICAL                  ),
     VALUE_CHAR(CERT_E_PURPOSE                   ),
     VALUE_CHAR(CERT_E_ISSUERCHAINING            ),
     VALUE_CHAR(CERT_E_MALFORMED                 ),
     VALUE_CHAR(CERT_E_UNTRUSTEDROOT             ),
     VALUE_CHAR(CERT_E_CHAINING                  ),
};


////////////////////////////////////////////////////////////////////////
// PROPSTATUSMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgPropStatusMap[] =
{
    VALUE_WCHAR(DBPROPSTATUS_OK),
	VALUE_WCHAR(DBPROPSTATUS_NOTSUPPORTED),
	VALUE_WCHAR(DBPROPSTATUS_BADVALUE),
	VALUE_WCHAR(DBPROPSTATUS_BADOPTION),
	VALUE_WCHAR(DBPROPSTATUS_BADCOLUMN),
	VALUE_WCHAR(DBPROPSTATUS_NOTALLSETTABLE),
	VALUE_WCHAR(DBPROPSTATUS_NOTSETTABLE),
	VALUE_WCHAR(DBPROPSTATUS_NOTSET),
	VALUE_WCHAR(DBPROPSTATUS_CONFLICTING),
	
	//2.1
	VALUE_WCHAR(DBPROPSTATUS_NOTAVAILABLE),
};


////////////////////////////////////////////////////////////////////////
// WCHAR* GetPropStatusName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetPropStatusName(DBPROPSTATUS dbPropStatus)
{
	return GetMapName(dbPropStatus, NUMELE(g_rgPropStatusMap), g_rgPropStatusMap);
}


////////////////////////////////////////////////////////////////////////
// STATUSMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgStatusMap[] =
{
    VALUE_WCHAR(DBSTATUS_S_OK	),
	VALUE_WCHAR(DBSTATUS_E_BADACCESSOR	),
	VALUE_WCHAR(DBSTATUS_E_CANTCONVERTVALUE	),
	VALUE_WCHAR(DBSTATUS_S_ISNULL	),
	VALUE_WCHAR(DBSTATUS_S_TRUNCATED	),
	VALUE_WCHAR(DBSTATUS_E_SIGNMISMATCH	),
	VALUE_WCHAR(DBSTATUS_E_DATAOVERFLOW	),
	VALUE_WCHAR(DBSTATUS_E_CANTCREATE	),
	VALUE_WCHAR(DBSTATUS_E_UNAVAILABLE	),
	VALUE_WCHAR(DBSTATUS_E_PERMISSIONDENIED	),
	VALUE_WCHAR(DBSTATUS_E_INTEGRITYVIOLATION	),
	VALUE_WCHAR(DBSTATUS_E_SCHEMAVIOLATION	),
	VALUE_WCHAR(DBSTATUS_E_BADSTATUS	),
	VALUE_WCHAR(DBSTATUS_S_DEFAULT	),

	//2.0
	VALUE_WCHAR(MDSTATUS_S_CELLEMPTY	),
	VALUE_WCHAR(DBSTATUS_S_IGNORE	),

	//2.1
    VALUE_WCHAR(DBSTATUS_E_DOESNOTEXIST),
	VALUE_WCHAR(DBSTATUS_E_INVALIDURL),
	VALUE_WCHAR(DBSTATUS_E_RESOURCELOCKED),
	VALUE_WCHAR(DBSTATUS_E_RESOURCEEXISTS),
	VALUE_WCHAR(DBSTATUS_E_CANNOTCOMPLETE),
	VALUE_WCHAR(DBSTATUS_E_VOLUMENOTFOUND),
	VALUE_WCHAR(DBSTATUS_E_OUTOFSPACE),
	VALUE_WCHAR(DBSTATUS_S_CANNOTDELETESOURCE),
	VALUE_WCHAR(DBSTATUS_E_READONLY),

	//2.5
	VALUE_WCHAR(DBSTATUS_E_CANCELED),
	VALUE_WCHAR(DBSTATUS_E_NOTCOLLECTION),

	//2.6
	VALUE_WCHAR(DBSTATUS_S_ROWSETCOLUMN	),
};


////////////////////////////////////////////////////////////////////////
// WCHAR* GetStatusName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetStatusName(DBSTATUS dbStatus, DWORD dwConvFlags)
{
	return GetMapName(dbStatus, NUMELE(g_rgStatusMap), g_rgStatusMap, dwConvFlags);
}

////////////////////////////////////////////////////////////////////////
// DBSTATUS GetStatusValue
//
////////////////////////////////////////////////////////////////////////
DBSTATUS GetStatusValue(WCHAR* pwszName)
{
	return GetMapName(pwszName, NUMELE(g_rgStatusMap), g_rgStatusMap);
}

////////////////////////////////////////////////////////////////////////
// PROPSET
//
////////////////////////////////////////////////////////////////////////
const static WIDEGUIDMAP g_rgPropSetMaps[] =
{
	//Property Sets
	VALUE_PWCHAR(DBPROPSET_COLUMN),
	VALUE_PWCHAR(DBPROPSET_DATASOURCE),
	VALUE_PWCHAR(DBPROPSET_DATASOURCEINFO),
	VALUE_PWCHAR(DBPROPSET_DBINIT),
	VALUE_PWCHAR(DBPROPSET_DBINITALL),
	VALUE_PWCHAR(DBPROPSET_INDEX),
	VALUE_PWCHAR(DBPROPSET_TABLE),
	VALUE_PWCHAR(DBPROPSET_VIEW),
	VALUE_PWCHAR(DBPROPSET_DATASOURCEALL),
	VALUE_PWCHAR(DBPROPSET_DATASOURCEINFOALL),
	VALUE_PWCHAR(DBPROPSET_ROWSET),
	VALUE_PWCHAR(DBPROPSET_ROWSETALL),
	VALUE_PWCHAR(DBPROPSET_SESSION),
	VALUE_PWCHAR(DBPROPSET_SESSIONALL),
	VALUE_PWCHAR(DBPROPSET_PROPERTIESINERROR),

	//2.1
	VALUE_PWCHAR(DBPROPSET_TRUSTEE),
	VALUE_PWCHAR(DBPROPSET_COLUMNALL),
	VALUE_PWCHAR(DBPROPSET_INDEXALL),
	VALUE_PWCHAR(DBPROPSET_TABLEALL),
	VALUE_PWCHAR(DBPROPSET_TRUSTEEALL),
	VALUE_PWCHAR(DBPROPSET_CONSTRAINTALL),

	//2.6
	VALUE_PWCHAR(DBPROPSET_STREAM),
	VALUE_PWCHAR(DBPROPSET_STREAMALL),

	//Negative Testing
	VALUE_PWCHAR(GUID_NULL),
};
const static ULONG g_cPropSetMaps = NUMELE(g_rgPropSetMaps);


////////////////////////////////////////////////////////////////////////
// IsSpecialPropSet
//
////////////////////////////////////////////////////////////////////////
BOOL IsSpecialPropSet(REFGUID guidSpecialPropertySet, GUID* pGuidPropertySet)
{
	//Special Property Sets
	typedef struct _SPECIALGUIDMAP
	{
		const GUID* pSpecialPropertySet;
		const GUID* pGuidPropertySet;
	} SPECIALGUIDMAP;
	
	const static SPECIALGUIDMAP rgSpecialPropSet[] = 
	{
		& DBPROPSET_COLUMNALL,						& DBPROPSET_COLUMN,
		& DBPROPSET_DATASOURCEALL,					& DBPROPSET_DATASOURCE,
		& DBPROPSET_DATASOURCEINFOALL,				& DBPROPSET_DATASOURCEINFO,
		& DBPROPSET_INDEXALL,						& DBPROPSET_INDEX,
		& DBPROPSET_DBINITALL,						& DBPROPSET_DBINIT,
		& DBPROPSET_SESSIONALL,						& DBPROPSET_SESSION,
		& DBPROPSET_TABLEALL,						& DBPROPSET_TABLE,
		& DBPROPSET_TRUSTEEALL,						& DBPROPSET_TRUSTEE,
		& DBPROPSET_VIEWALL,						& DBPROPSET_VIEW,
		& DBPROPSET_ROWSETALL,						& DBPROPSET_ROWSET,
		& DBPROPSET_STREAMALL,						& DBPROPSET_STREAM,
	};

	//Is this one of the special Property Sets
	for(ULONG iPropSet=0; iPropSet<NUMELE(rgSpecialPropSet); iPropSet++)
	{
		const SPECIALGUIDMAP* pSpecPropSet = &rgSpecialPropSet[iPropSet];
		if(guidSpecialPropertySet == *pSpecPropSet->pSpecialPropertySet)
		{
			if(pGuidPropertySet)
				*pGuidPropertySet = *pSpecPropSet->pGuidPropertySet;
			return TRUE;
		}
	}

	//Not a special set...
	return FALSE;
}


	
////////////////////////////////////////////////////////////////////////
// GetStaticPropValues
//
////////////////////////////////////////////////////////////////////////
HRESULT GetStaticPropValues(DBPROPID dwPropertyID, REFGUID guidPropertySet, ULONG* pcPropValMap, const WIDENAMEMAP** prgPropValMap)
{
	ASSERT(pcPropValMap);
	ASSERT(prgPropValMap);
	
	//DBPROPSET_ROWSET
	if(guidPropertySet == DBPROPSET_ROWSET)
	{
		switch(dwPropertyID)
		{
			case DBPROP_UPDATABILITY:
			{
				const static WIDENAMEMAP rgUPDATABILITY[] =
				{
					VALUE_WCHAR(DBPROPVAL_UP_CHANGE	),
					VALUE_WCHAR(DBPROPVAL_UP_DELETE	),
					VALUE_WCHAR(DBPROPVAL_UP_INSERT	),
				};
				
				*pcPropValMap = NUMELE(rgUPDATABILITY);
				*prgPropValMap = rgUPDATABILITY;
				return S_OK;
			}
		};
	}
	else if(guidPropertySet == DBPROPSET_DBINIT)
	{
		switch(dwPropertyID)
		{
			case DBPROP_INIT_PROMPT:
			{
				const static WIDENAMEMAP rgPrompts[] =
				{
					VALUE_WCHAR(DBPROMPT_PROMPT),
					VALUE_WCHAR(DBPROMPT_COMPLETE),
					VALUE_WCHAR(DBPROMPT_COMPLETEREQUIRED),
					VALUE_WCHAR(DBPROMPT_NOPROMPT),
				};

				*pcPropValMap = NUMELE(rgPrompts);
				*prgPropValMap = rgPrompts;
				return S_OK;
			}
		};
	}

	return DB_E_NOTFOUND;
}


////////////////////////////////////////////////////////////////////////
// GetStaticPropInfo
//
////////////////////////////////////////////////////////////////////////
HRESULT GetStaticPropInfo(ULONG cPropertyIDSets, DBPROPIDSET* rgPropertyIDSets, ULONG* pcStaticInfoSets, const DBPROPINFOSET** prgStaticInfoSets)
{
	HRESULT hr = S_OK;
	ASSERT(pcStaticInfoSets);
	ASSERT(prgStaticInfoSets);

	//DBPROPSET_COLUMN
	const static DBPROPINFO rgColumnPropInfo[] =
	{
		VALUE_WCHAR(DBPROP_COL_AUTOINCREMENT),			DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_DEFAULT	),				DBPROPFLAGS_COLUMN,			DBTYPE_EMPTY,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_DESCRIPTION	),			DBPROPFLAGS_COLUMN,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_FIXEDLENGTH	),			DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_INCREMENT),				DBPROPFLAGS_COLUMN,			DBTYPE_EMPTY,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_ISLONG),					DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_NULLABLE	),				DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_PRIMARYKEY	),			DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_UNIQUE	),				DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COLUMNLCID),					DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_SEED),					DBPROPFLAGS_COLUMN,			DBTYPE_EMPTY,		{0,0,0,0,0},
	};

	//DBPROPSET_DATASOURCE
	const static DBPROPINFO rgDataSourcePropInfo[] =
	{
		VALUE_WCHAR(DBPROP_CURRENTCATALOG	),			DBPROPFLAGS_DATASOURCE,		DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MULTIPLECONNECTIONS),		DBPROPFLAGS_DATASOURCE,		DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_RESETDATASOURCE),			DBPROPFLAGS_DATASOURCE,		DBTYPE_I4,			{0,0,0,0,0},
	};

	//DBPROPSET_DATASOURCEINFO
	const static DBPROPINFO rgDataSourceInfoPropInfo[] =
	{
		VALUE_WCHAR(DBPROP_ACTIVESESSIONS	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ALTERCOLUMN),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ASYNCTXNABORT	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ASYNCTXNCOMMIT	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_BYREFACCESSORS	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CATALOGLOCATION	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CATALOGTERM	),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CATALOGUSAGE	),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COLUMNDEFINITION	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COMSERVICES	),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CONCATNULLBEHAVIOR	),		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CONNECTIONSTATUS),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DATASOURCENAME	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DATASOURCEREADONLY	),		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DATASOURCE_TYPE),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DBMSNAME	),					DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DBMSVER	),					DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DSOTHREADMODEL	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_GENERATEURL),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_GROUPBY	),					DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_HETEROGENEOUSTABLES	),		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IDENTIFIERCASE),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXINDEXSIZE	),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXOPENCHAPTERS	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXROWSIZE	),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXROWSIZEINCLUDESBLOB	),	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXTABLESINSELECT	),		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MULTIPLEPARAMSETS	),		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MULTIPLERESULTS	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MULTIPLESTORAGEOBJECTS	),	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_MULTITABLEUPDATE	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NULLCOLLATION	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OLEOBJECTS	),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OPENROWSETSUPPORT),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_ORDERBYCOLUMNSINSELECT	),	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OUTPUTPARAMETERAVAILABILITY	),	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PERSISTENTIDTYPE	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PREPAREABORTBEHAVIOR	),		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PREPARECOMMITBEHAVIOR	),	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PROCEDURETERM	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PROVIDERFRIENDLYNAME),		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PROVIDERMEMORY),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_PROVIDERFILENAME	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PROVIDEROLEDBVER	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PROVIDERVER	),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_QUOTEDIDENTIFIERCASE	),		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ROWSETCONVERSIONSONCOMMAND	),	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SCHEMATERM	),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SCHEMAUSAGE	),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SERVERNAME),					DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_SQLSUPPORT	),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_STRUCTUREDSTORAGE	),		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SUBQUERIES	),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SUPPORTEDTXNDDL	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SUPPORTEDTXNISOLEVELS	),	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SUPPORTEDTXNISORETAIN	),	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_TABLETERM	),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_TABLESTATISTICS	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_USERNAME	),					DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
	
		//OLAP Documention
		VALUE_WCHAR(MDPROP_AXES),						DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_FLATTENING_SUPPORT),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_JOINCUBES),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_NAMED_LEVELS),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_RANGEROWSET),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_SLICER),					DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_CUBEQUALIFICATION),		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_OUTERREFERENCE),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_QUERYBYPROPERTY),		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_CASESUPPORT),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_STRING_COMPOP),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_DESCFLAGS),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_SET_FUNCTIONS),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_MEMBER_FUNCTIONS),		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_NUMERIC_FUNCTIONS),		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_FORMULAS),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_AGGREGATECELL_UPDATE),	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},	

		//Not yet doc'd...
		VALUE_WCHAR(DBPROP_STORAGEFLAGS),				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},

		//2.6
		VALUE_WCHAR(DBPROP_TABLESTATISTICS	),			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
	};

	//DBPROPSET_INDEX
	const static DBPROPINFO rgIndexPropInfo[] =
	{
		VALUE_WCHAR(DBPROP_INDEX_AUTOUPDATE),			DBPROPFLAGS_INDEX,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_CLUSTERED),			DBPROPFLAGS_INDEX,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_FILLFACTOR),			DBPROPFLAGS_INDEX,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_INITIALSIZE),			DBPROPFLAGS_INDEX,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_NULLCOLLATION),		DBPROPFLAGS_INDEX,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_NULLS),				DBPROPFLAGS_INDEX,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_PRIMARYKEY),			DBPROPFLAGS_INDEX,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_SORTBOOKMARKS),		DBPROPFLAGS_INDEX,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_TEMPINDEX),			DBPROPFLAGS_INDEX,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_TYPE),					DBPROPFLAGS_INDEX,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_UNIQUE),				DBPROPFLAGS_INDEX,			DBTYPE_BOOL,		{0,0,0,0,0},
	};

	//DBPROPSET_DBINIT
	const static DBPROPINFO rgInitPropInfo[] =
	{
		VALUE_WCHAR(DBPROP_AUTH_CACHE_AUTHINFO	),		DBPROPFLAGS_DBINIT,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_AUTH_ENCRYPT_PASSWORD	),	DBPROPFLAGS_DBINIT,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_AUTH_INTEGRATED	),			DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_AUTH_MASK_PASSWORD	),		DBPROPFLAGS_DBINIT,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_AUTH_PASSWORD	),			DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_AUTH_PERSIST_ENCRYPTED	),	DBPROPFLAGS_DBINIT,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO	),		DBPROPFLAGS_DBINIT,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_AUTH_USERID	),				DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_ASYNCH),				DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_BINDFLAGS),				DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_CATALOG),				DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_DATASOURCE),			DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_GENERALTIMEOUT),		DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_HWND	),				DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_IMPERSONATION_LEVEL	),	DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_LCID	),				DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_LOCATION	),			DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_LOCKOWNER),				DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_MODE	),				DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_OLEDBSERVICES),			DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_PROMPT	),				DBPROPFLAGS_DBINIT,			DBTYPE_I2,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_PROTECTION_LEVEL	),	DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_PROVIDERSTRING	),		DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_TIMEOUT	),				DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
	};

	//DBPROPSET_SESSION
	const static DBPROPINFO rgSessionPropInfo[] =
	{
		VALUE_WCHAR(DBPROP_SESS_AUTOCOMMITISOLEVELS	),	DBPROPFLAGS_SESSION,		DBTYPE_I4,			{0,0,0,0,0},
	};
	
	//DBPROPSET_TABLE
	const static DBPROPINFO rgTablePropInfo[] =
	{
		VALUE_WCHAR(DBPROP_TBL_TEMPTABLE	),			DBPROPFLAGS_TABLE,			DBTYPE_BOOL,		{0,0,0,0,0},
	};

	//DBPROPSET_TRUSTEE
	const static DBPROPINFO rgTrusteePropInfo[] =
	{
		//Documented in Security Whitepaper
		VALUE_WCHAR(DBPROP_TRUSTEE_USERNAME),			DBPROPFLAGS_TRUSTEE,		DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_TRUSTEE_AUTHENTICATION),		DBPROPFLAGS_TRUSTEE,		DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_TRUSTEE_NEWAUTHENTICATION),	DBPROPFLAGS_TRUSTEE,		DBTYPE_BOOL,		{0,0,0,0,0},	
	};

	//DBPROPSET_VIEW
	const static DBPROPINFO rgViewPropInfo[] =
	{
		VALUE_WCHAR(DBPROP_FILTERCOMPAREOPS	),			DBPROPFLAGS_VIEW,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IAccessor	),				DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IColumnsInfo	),				DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_ISupportErrorInfo),			DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IViewChapter),				DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IViewFilter),				DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IViewRowset),				DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IViewSort),					DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_MAXORSINFILTER	),			DBPROPFLAGS_VIEW,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXSORTCOLUMNS	),			DBPROPFLAGS_VIEW,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SORTONINDEX	),				DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},
	};

	//DBPROPSET_ROWSET
	const static DBPROPINFO rgRowsetPropInfo[] =
	{
		VALUE_WCHAR(DBPROP_ABORTPRESERVE	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_ACCESSORDER),				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_APPENDONLY	),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_BLOCKINGSTORAGEOBJECTS	),	DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_BOOKMARKINFO),				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_BOOKMARKS	),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_BOOKMARKSKIPPED	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_BOOKMARKTYPE	),				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CACHEDEFERRED	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CANFETCHBACKWARDS	),		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CANHOLDROWS	),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CANSCROLLBACKWARDS	),		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CHANGEINSERTEDROWS	),		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CLIENTCURSOR),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COLUMNRESTRICT	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COMMANDTIMEOUT	),			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COMMITPRESERVE	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DEFERRED	),					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DELAYSTORAGEOBJECTS	),		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_FINDCOMPAREOPS	),			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_HIDDENCOLUMNS),				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IAccessor	),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IChapteredRowset	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IColumnsInfo	),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IColumnsInfo2),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IColumnsRowset	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IConnectionPointContainer),	DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IConvertType	),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ICreateRow),					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IDBAsynchStatus	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IGetRow),					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IGetSession),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IGetSourceRow),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ILockBytes),					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IMMOBILEROWS),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IMultipleResults),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IParentRowset),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IRow),						DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowChange),					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowSchemaChange),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowset	),					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetChange	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetCurrentIndex),		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IRowsetFind	),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetIdentity),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetIndex),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetInfo),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetLocate),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetRefresh),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetScroll),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetUpdate),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetView),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IScopedOperations),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ISequentialStream),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IStorage),					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IStream),					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ISupportErrorInfo),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_LITERALBOOKMARKS	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_LITERALIDENTITY	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_LOCKMODE),					DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXOPENROWS	),				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXPENDINGROWS	),			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXROWS	),					DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAYWRITECOLUMN	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MEMORYUSAGE	),				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFICATIONGRANULARITY	),	DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_NOTIFICATIONPHASES	),		DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYCOLUMNSET	),			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWDELETE	),			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWFIRSTCHANGE	),		DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWINSERT	),			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWRESYNCH	),			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWSETRELEASE	),		DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWSETFETCHPOSITIONCHANGE),	DBPROPFLAGS_ROWSET,			DBTYPE_I4,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWUNDOCHANGE	),		DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWUNDODELETE	),		DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWUNDOINSERT	),		DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWUPDATE	),			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ORDEREDBOOKMARKS	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OTHERINSERT	),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OTHERUPDATEDELETE	),		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OWNINSERT	),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OWNUPDATEDELETE	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_QUICKRESTART	),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_REENTRANTEVENTS	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_REMOVEDELETED	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_REPORTMULTIPLECHANGES	),	DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_RETURNPENDINGINSERTS	),		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ROW_BULKOPS),				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ROWRESTRICT	),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ROWSET_ASYNCH	),			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ROWTHREADMODEL	),			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SERVERCURSOR	),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SERVERDATAONINSERT),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_STRONGIDENTITY	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_TRANSACTEDOBJECT	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_UNIQUEROWS),					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_UPDATABILITY	),				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},

		//2.6
		//TODO: IRowsetBookmark and property are not doc'd - as of today?
		VALUE_WCHAR(DBPROP_IRowsetBookmark	),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SKIPROWCOUNTRESULTS	),		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},

		//Currently not doc'd due to unknown property set...
		VALUE_WCHAR(DBPROP_IBindResource),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IDBBinderProperties),		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IRegisterProvider),			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IRowsetResynch),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},

		//Deprecated Properties
//		VALUE_WCHAR(DBPROP_MARSHALLABLE	),				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},		
	};
	
	//DBPROPSET_STREAM
	const static DBPROPINFO rgStreamPropInfo[] =
	{
		VALUE_WCHAR(DBPROP_OUTPUTSTREAM	),				DBPROPFLAGS_STREAM,			DBTYPE_IUNKNOWN,	{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OUTPUTENCODING),				DBPROPFLAGS_STREAM,			DBTYPE_BSTR,		{0,0,0,0,0},
	};

	
	//Now build a static map of all the sets...
	const static DBPROPINFOSET rgAllPropInfoSet[] = 
	{
		//DBPROPSET_COLUMN
		(DBPROPINFO*)rgColumnPropInfo,				NUMELE(rgColumnPropInfo), 			{0xc8b522b9,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}},
		//DBPROPSET_DATASOURCE
		(DBPROPINFO*)rgDataSourcePropInfo,			NUMELE(rgDataSourcePropInfo),		{0xc8b522ba,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}},
		//DBPROPSET_DATASOURCEINFO
		(DBPROPINFO*)rgDataSourceInfoPropInfo,		NUMELE(rgDataSourceInfoPropInfo),	{0xc8b522bb,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}},
		//DBPROPSET_INDEX
		(DBPROPINFO*)rgIndexPropInfo,				NUMELE(rgIndexPropInfo),			{0xc8b522bd,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}},
		//DBPROPSET_DBINIT
		(DBPROPINFO*)rgInitPropInfo,				NUMELE(rgInitPropInfo),				{0xc8b522bc,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}},
		//DBPROPSET_SESSION
		(DBPROPINFO*)rgSessionPropInfo,				NUMELE(rgSessionPropInfo),			{0xc8b522c6,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}},
		//DBPROPSET_TABLE
		(DBPROPINFO*)rgTablePropInfo,				NUMELE(rgTablePropInfo),			{0xc8b522bf,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}},
		//DBPROPSET_TRUSTEE
		(DBPROPINFO*)rgTrusteePropInfo,				NUMELE(rgTrusteePropInfo),			{0xc8b522e1,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}},
		//DBPROPSET_VIEW
		(DBPROPINFO*)rgViewPropInfo,				NUMELE(rgViewPropInfo),				{0xc8b522df,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}},
		//DBPROPSET_ROWSET
		(DBPROPINFO*)rgRowsetPropInfo,				NUMELE(rgRowsetPropInfo),			{0xc8b522be,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}},
		//DBPROPSET_STREAM
		(DBPROPINFO*)rgStreamPropInfo,				NUMELE(rgStreamPropInfo),			{0xc8b522fd,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}},
	};

	if(cPropertyIDSets == 0)
	{
		//Return all OLE DB Defined sets to the caller.
		*pcStaticInfoSets		= NUMELE(rgAllPropInfoSet);
		*prgStaticInfoSets		= rgAllPropInfoSet;
		return S_OK;
	}
	else
	{
		//Currently this routine only handles one level.
		//All that we currently need at this point for RowsetViewer...
		ASSERT(cPropertyIDSets==1);
		ASSERT(rgPropertyIDSets && rgPropertyIDSets[0].cPropertyIDs==0);

		//First, is this a special property set, then map it to its defined property set...?
		GUID guidSpecialPropertySet = rgPropertyIDSets[0].guidPropertySet;
		IsSpecialPropSet(guidSpecialPropertySet, &guidSpecialPropertySet);
		
		//Now loop through all the Property Sets and see which is desired...
		for(ULONG iPropSet=0; iPropSet<NUMELE(rgAllPropInfoSet); iPropSet++)
		{
			const DBPROPINFOSET* pPropInfoSet = &rgAllPropInfoSet[iPropSet];
			if(guidSpecialPropertySet == pPropInfoSet->guidPropertySet)
			{
				*pcStaticInfoSets		= 1;
				*prgStaticInfoSets		= pPropInfoSet;
				return S_OK;
			}
		}
	}

//CLEANUP:
	//Otherwise propety set was not found...
	*pcStaticInfoSets = 0;
	*prgStaticInfoSets = NULL;
	return DB_E_NOTFOUND;
};


////////////////////////////////////////////////////////////////////////
// GetAllocedPropInfo
//
////////////////////////////////////////////////////////////////////////
HRESULT GetAllocedPropInfo(ULONG cPropertyIDSets, DBPROPIDSET* rgPropertyIDSets, ULONG* pcPropInfoSets, DBPROPINFOSET** prgPropInfoSets)
{
	HRESULT hr = S_OK;
	ASSERT(pcPropInfoSets);		
	ASSERT(prgPropInfoSets);

	ULONG iPropSet,cStaticInfoSets = 0;
	const DBPROPINFOSET* rgStaticInfoSets = NULL;

	ULONG cPropInfoSets = 0;
	DBPROPINFOSET* rgPropInfoSets = NULL;

	//Delegate
	TESTC(hr = GetStaticPropInfo(cPropertyIDSets, rgPropertyIDSets, &cStaticInfoSets, &rgStaticInfoSets));

	//Now dump this static info into an allocated DBPROPINFOSET...
	SAFE_ALLOC(rgPropInfoSets, DBPROPINFOSET, cStaticInfoSets);
	cPropInfoSets = cStaticInfoSets;
	for(iPropSet=0; iPropSet<cStaticInfoSets; iPropSet++)
	{
		//Setup outer
		rgPropInfoSets[iPropSet].cPropertyInfos		= rgStaticInfoSets[iPropSet].cPropertyInfos;
		rgPropInfoSets[iPropSet].guidPropertySet	= rgStaticInfoSets[iPropSet].guidPropertySet;
		SAFE_ALLOC(rgPropInfoSets[iPropSet].rgPropertyInfos, DBPROPINFO, rgStaticInfoSets[iPropSet].cPropertyInfos);
		memcpy(rgPropInfoSets[iPropSet].rgPropertyInfos, rgStaticInfoSets[iPropSet].rgPropertyInfos, sizeof(DBPROPINFO)*rgStaticInfoSets[iPropSet].cPropertyInfos);
	}

CLEANUP:
	*pcPropInfoSets = cPropInfoSets;
	*prgPropInfoSets = rgPropInfoSets;
	return hr;
};


////////////////////////////////////////////////////////////////////////
// PROPFLAGS
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgPropFlagsMap[] =
{
    VALUE_WCHAR(DBPROPFLAGS_NOTSUPPORTED	),
	VALUE_WCHAR(DBPROPFLAGS_COLUMN	),
	VALUE_WCHAR(DBPROPFLAGS_DATASOURCE	),
	VALUE_WCHAR(DBPROPFLAGS_DATASOURCECREATE	),
	VALUE_WCHAR(DBPROPFLAGS_DATASOURCEINFO	),
	VALUE_WCHAR(DBPROPFLAGS_DBINIT	),
	VALUE_WCHAR(DBPROPFLAGS_INDEX	),
	VALUE_WCHAR(DBPROPFLAGS_ROWSET	),
	VALUE_WCHAR(DBPROPFLAGS_TABLE	),
	VALUE_WCHAR(DBPROPFLAGS_COLUMNOK	),
	VALUE_WCHAR(DBPROPFLAGS_READ	),
	VALUE_WCHAR(DBPROPFLAGS_WRITE	),
	VALUE_WCHAR(DBPROPFLAGS_REQUIRED	),
	VALUE_WCHAR(DBPROPFLAGS_SESSION	),

	//2.1
    VALUE_WCHAR(DBPROPFLAGS_TRUSTEE),
};


const static WIDENAMEMAP g_rgIsoLevels[] =
{
	VALUE_WCHAR(ISOLATIONLEVEL_UNSPECIFIED	),
	VALUE_WCHAR(ISOLATIONLEVEL_CHAOS	),
	VALUE_WCHAR(ISOLATIONLEVEL_READUNCOMMITTED	),
	VALUE_WCHAR(ISOLATIONLEVEL_BROWSE	),
	VALUE_WCHAR(ISOLATIONLEVEL_CURSORSTABILITY	),
	VALUE_WCHAR(ISOLATIONLEVEL_READCOMMITTED	),
	VALUE_WCHAR(ISOLATIONLEVEL_REPEATABLEREAD	),
	VALUE_WCHAR(ISOLATIONLEVEL_SERIALIZABLE	),
	VALUE_WCHAR(ISOLATIONLEVEL_ISOLATED	),
};
const static ULONG g_cIsoLevels = NUMELE(g_rgIsoLevels);


const static WIDENAMEMAP g_rgXACTTC[] =
{	
	VALUE_WCHAR(XACTTC_SYNC_PHASEONE	),
	VALUE_WCHAR(XACTTC_SYNC_PHASETWO	),
	VALUE_WCHAR(XACTTC_SYNC	),
	VALUE_WCHAR(XACTTC_ASYNC_PHASEONE	),
};
const static ULONG g_cXACTTC = NUMELE(g_rgXACTTC);

			
////////////////////////////////////////////////////////////////////////
// OBJECTYTPEMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDEGUIDMAP g_rgObjectTypeMaps[] =
{
    VALUE_PWCHAR(DBGUID_DSO	),
	VALUE_PWCHAR(DBGUID_SESSION	),
	VALUE_PWCHAR(DBGUID_ROWSET	),
	VALUE_PWCHAR(DBGUID_ROW	),
	VALUE_PWCHAR(DBGUID_COMMAND	),
	VALUE_PWCHAR(DBGUID_STREAM	),

	//Negative testing
	VALUE_PWCHAR(GUID_NULL	),
};
const static ULONG g_cObjectTypeMaps = NUMELE(g_rgObjectTypeMaps);


////////////////////////////////////////////////////////////////////////
// ROWCOLMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDEDBIDMAP g_rgRowColMaps[] =
{
	VALUE_PWCHAR(DBROWCOL_DEFAULTSTREAM),        
	VALUE_PWCHAR(DBROWCOL_DEFAULTDOCUMENT),      
	VALUE_PWCHAR(DBROWCOL_ROWURL),		        
	VALUE_PWCHAR(DBROWCOL_PARSENAME),            
	VALUE_PWCHAR(DBROWCOL_PARENTNAME),           
	VALUE_PWCHAR(DBROWCOL_ABSOLUTEPARSENAME),    
	VALUE_PWCHAR(DBROWCOL_CONTENTTYPE),          
	VALUE_PWCHAR(DBROWCOL_CONTENTCLASS),         
	VALUE_PWCHAR(DBROWCOL_CONTENTLANGUAGE),      
	VALUE_PWCHAR(DBROWCOL_CREATIONTIME),         
	VALUE_PWCHAR(DBROWCOL_LASTACCESSTIME),       
	VALUE_PWCHAR(DBROWCOL_LASTWRITETIME),        
	VALUE_PWCHAR(DBROWCOL_STREAMSIZE),           
	VALUE_PWCHAR(DBROWCOL_DISPLAYNAME),          
	VALUE_PWCHAR(DBROWCOL_ISROOT),               
	VALUE_PWCHAR(DBROWCOL_ISCOLLECTION),         
	VALUE_PWCHAR(DBROWCOL_ISSTRUCTUREDDOCUMENT), 
	VALUE_PWCHAR(DBROWCOL_ISHIDDEN),             
	VALUE_PWCHAR(DBROWCOL_ISREADONLY),           

	//Negative testing
	VALUE_PWCHAR(DB_NULLID	),
};
const static ULONG g_cRowColMaps = NUMELE(g_rgRowColMaps);


////////////////////////////////////////////////////////////////////////
// WCHAR* GetRowColName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetRowColName(const DBID* pColumnid)
{
	return GetMapName(pColumnid, g_cRowColMaps, g_rgRowColMaps);
}


////////////////////////////////////////////////////////////////////////
// DBPROMPTOPTIONS
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgPromptOptions[] = 
{
	VALUE_WCHAR(DBPROMPTOPTIONS_WIZARDSHEET),
	VALUE_WCHAR(DBPROMPTOPTIONS_PROPERTYSHEET),
	VALUE_WCHAR(DBPROMPTOPTIONS_BROWSEONLY),
	VALUE_WCHAR(DBPROMPTOPTIONS_DISABLE_PROVIDER_SELECTION),
	VALUE_WCHAR(DBPROMPTOPTIONS_DISABLESAVEPASSWORD),
};
const static ULONG g_cPromptOptions = NUMELE(g_rgPromptOptions);

			
////////////////////////////////////////////////////////////////////////
// DBSOURCETYPE
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgSourceType[] = 
{
    VALUE_WCHAR(DBSOURCETYPE_DATASOURCE),
	VALUE_WCHAR(DBSOURCETYPE_ENUMERATOR),
	VALUE_WCHAR(DBSOURCETYPE_BINDER),
	VALUE_WCHAR(DBSOURCETYPE_DATASOURCE_MDP),
};
const static ULONG g_cSourceType = NUMELE(g_rgSourceType);


////////////////////////////////////////////////////////////////////////
// DBBINDURLMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgBindURLMaps[] =
{
    VALUE_WCHAR(DBBINDURLFLAG_READ),
	VALUE_WCHAR(DBBINDURLFLAG_WRITE),
	VALUE_WCHAR(DBBINDURLFLAG_READWRITE),
	VALUE_WCHAR(DBBINDURLFLAG_SHARE_DENY_READ),
	VALUE_WCHAR(DBBINDURLFLAG_SHARE_DENY_WRITE),
	VALUE_WCHAR(DBBINDURLFLAG_SHARE_EXCLUSIVE),
	VALUE_WCHAR(DBBINDURLFLAG_SHARE_DENY_NONE),
	VALUE_WCHAR(DBBINDURLFLAG_ASYNCHRONOUS),
	VALUE_WCHAR(DBBINDURLFLAG_COLLECTION),
	VALUE_WCHAR(DBBINDURLFLAG_DELAYFETCHSTREAM),
	VALUE_WCHAR(DBBINDURLFLAG_DELAYFETCHCOLUMNS),
	VALUE_WCHAR(DBBINDURLFLAG_RECURSIVE),
	VALUE_WCHAR(DBBINDURLFLAG_OUTPUT),
	VALUE_WCHAR(DBBINDURLFLAG_WAITFORINIT),
	VALUE_WCHAR(DBBINDURLFLAG_OPENIFEXISTS),
	VALUE_WCHAR(DBBINDURLFLAG_OVERWRITE),
	VALUE_WCHAR(DBBINDURLFLAG_ISSTRUCTUREDDOCUMENT),
};
const static ULONG g_cBindURLMaps = NUMELE(g_rgBindURLMaps);


////////////////////////////////////////////////////////////////////////
// DBCONSTRAINTTYPE
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgConsTypeMaps[] =
{
	//Constraint Types
	VALUE_WCHAR(DBCONSTRAINTTYPE_UNIQUE),
	VALUE_WCHAR(DBCONSTRAINTTYPE_FOREIGNKEY),
	VALUE_WCHAR(DBCONSTRAINTTYPE_PRIMARYKEY),
	VALUE_WCHAR(DBCONSTRAINTTYPE_CHECK),
};
const static ULONG	g_cConsTypeMaps = NUMELE(g_rgConsTypeMaps);


////////////////////////////////////////////////////////////////////////
// DBDEFERRABILITY
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgDeferrabilityMaps[] =
{
	//Deferrability flags
	VALUE_WCHAR(DBDEFERRABILITY_DEFERRED),
	VALUE_WCHAR(DBDEFERRABILITY_DEFERRABLE),
};
const static ULONG	g_cDeferrabilityMaps = NUMELE(g_rgDeferrabilityMaps);


////////////////////////////////////////////////////////////////////////
// DBMATCHTYPE
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgMatchTypeMaps[] =
{
	//Match type values
	VALUE_WCHAR(DBMATCHTYPE_NONE),
	VALUE_WCHAR(DBMATCHTYPE_FULL),
	VALUE_WCHAR(DBMATCHTYPE_PARTIAL),
};
const static ULONG	g_cMatchTypeMaps = NUMELE(g_rgMatchTypeMaps);


////////////////////////////////////////////////////////////////////////
// DBUPDELRULE
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgUpDelRuleMaps[] =
{
	//Update/Delete rule values
	VALUE_WCHAR(DBUPDELRULE_NOACTION),
	VALUE_WCHAR(DBUPDELRULE_CASCADE),
	VALUE_WCHAR(DBUPDELRULE_SETNULL),
	VALUE_WCHAR(DBUPDELRULE_SETDEFAULT),
};
const static ULONG	g_cUpDelRuleMaps = NUMELE(g_rgUpDelRuleMaps);


////////////////////////////////////////////////////////////////////////
// DBCOLUMNDESCFLAGS
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgCDFlagsMaps[] =
{
	//Deferrability flags
	VALUE_WCHAR(DBCOLUMNDESCFLAGS_TYPENAME),
	VALUE_WCHAR(DBCOLUMNDESCFLAGS_ITYPEINFO),
	VALUE_WCHAR(DBCOLUMNDESCFLAGS_PROPERTIES),
	VALUE_WCHAR(DBCOLUMNDESCFLAGS_CLSID),
	VALUE_WCHAR(DBCOLUMNDESCFLAGS_COLSIZE),
	VALUE_WCHAR(DBCOLUMNDESCFLAGS_DBCID),
	VALUE_WCHAR(DBCOLUMNDESCFLAGS_WTYPE),
	VALUE_WCHAR(DBCOLUMNDESCFLAGS_PRECISION),
	VALUE_WCHAR(DBCOLUMNDESCFLAGS_SCALE),
};
const static ULONG	g_cCDFlagsMaps = NUMELE(g_rgCDFlagsMaps);


////////////////////////////////////////////////////////////////////////
// WCHAR* GetObjectTypeName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetObjectTypeName(REFGUID rguidObjectType)
{
	return GetMapName(rguidObjectType, g_cObjectTypeMaps, g_rgObjectTypeMaps);
}


////////////////////////////////////////////////////////////////////////
// WCHAR* GetPropertyName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetPropertyName(DBPROPID dwPropertyID, REFGUID guidPropertySet)
{
	//Thankfully all OLE DB Properties have different DBPROPIDs, (all unique)
	//The problem is that provider specific properties may not be.
	//So if we know the set we can find the property, otherwsie we don't know it...
	ULONG cPropInfoSets = 0;
	const DBPROPINFOSET* rgPropInfoSets = NULL;
	DBPROPINFO* pPropInfo = NULL;

	//Setup the info we are looking for...
	const ULONG cPropertyIDSets = 1;
	DBPROPIDSET rgPropertyIDSets[cPropertyIDSets];
	rgPropertyIDSets[0].cPropertyIDs = 0;
	rgPropertyIDSets[0].rgPropertyIDs = NULL;
	rgPropertyIDSets[0].guidPropertySet = guidPropertySet;

	//Obtain the properties for the specified set...
	TESTC(GetStaticPropInfo(cPropertyIDSets, rgPropertyIDSets, &cPropInfoSets, &rgPropInfoSets));
		
	//Now that we have the correct set, just obtain the sub element (property name)
	pPropInfo = FindProperty(dwPropertyID, guidPropertySet, cPropInfoSets, (DBPROPINFOSET*)rgPropInfoSets);
	if(pPropInfo)
		return pPropInfo->pwszDescription;

CLEANUP:
	return NULL;
}


////////////////////////////////////////////////////////////////////////
// WCHAR* GetPropSetName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetPropSetName(REFGUID guidPropertySet)
{
	return GetMapName(guidPropertySet, g_cPropSetMaps, g_rgPropSetMaps);
}


////////////////////////////////////////////////////////////////////////
// LCID
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgLCID[] =
{
	VALUE_WCHAR(LOCALE_SYSTEM_DEFAULT),
	VALUE_WCHAR(LOCALE_USER_DEFAULT),
	VALUE_WCHAR(LOCALE_NEUTRAL),
	VALUE_WCHAR(GetSystemDefaultLCID()),
	VALUE_WCHAR(GetUserDefaultLCID()),
};
const static ULONG g_cLCID = NUMELE(g_rgLCID);



////////////////////////////////////////////////////////////////////////
// CHAR* GetMapName
//
////////////////////////////////////////////////////////////////////////
CHAR* GetMapName(LONG lItem, ULONG cNameMap, const NAMEMAP* rgNameMap)
{
	for(ULONG i=0; i<cNameMap; i++)
	{
		if(lItem == rgNameMap[i].lItem) 
			return rgNameMap[i].pszName;
	}

	//Otherwise indicate failure
	return NULL;
}


////////////////////////////////////////////////////////////////////////
// GetMapName
//
////////////////////////////////////////////////////////////////////////
LONG GetMapName(WCHAR* pwsz, ULONG cNameMap, const WIDENAMEMAP* rgNameMap)
{
	for(ULONG i=0; i<cNameMap; i++)
	{
		if(StringCompare(pwsz, rgNameMap[i].pwszName)) 
			return rgNameMap[i].lItem;
	}

	//Otherwise indicate failure
	return -1;
}

////////////////////////////////////////////////////////////////////////
// GetMapName
//
////////////////////////////////////////////////////////////////////////
LONG GetMapName(CHAR* psz, ULONG cNameMap, const NAMEMAP* rgNameMap)
{
	for(ULONG i=0; i<cNameMap; i++)
	{
		if(strcmp(psz, rgNameMap[i].pszName)==0) 
			return rgNameMap[i].lItem;
	}

	//Otherwise indicate failure
	return -1;
}


////////////////////////////////////////////////////////////////////////
// WCHAR* GetMapName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetMapName(LONG lItem, ULONG cNameMap, const WIDENAMEMAP* rgNameMap, DWORD dwConvFlags)
{
	for(ULONG i=0; i<cNameMap; i++)
	{
		if(lItem == rgNameMap[i].lItem) 
			return rgNameMap[i].pwszName;
	}

	if(dwConvFlags)
	{
		//If we didn't find it, then just format the value in a string
		//and return it to the user (if requested)...
		static WCHAR wszBuffer[MAX_NAME_LEN];
		if(dwConvFlags & CONV_HEX)
			StringFormat(wszBuffer, NUMELE(wszBuffer), L"0x%x", lItem);
		else
			StringFormat(wszBuffer, NUMELE(wszBuffer), L"%d", lItem);
		return wszBuffer;
	}

	//Otherwise indicate failure
	return NULL;
}


////////////////////////////////////////////////////////////////////////
// WCHAR* GetBitMapName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetBitMapName(DWORD dwItem, ULONG cNameMap, const WIDENAMEMAP* rgNameMap, DWORD dwBitStart)
{
	static WCHAR wszBuffer[MAX_NAME_LEN] = {0};
	DWORD dwItemBase = dwItem;
	DWORD dwFound = 0;

	//NOTE: Some bitmasks, are actually composed of some sequental values, and then some bits.
	//For Example, DBTYPE_* contains sequential types upto a point, and then the rest are bit masks.
	//This function is designed to handle this case as well, dwBitStart denotes all bits that
	//are allowed to be on, all other values (non-indicated-bits) will be compared literally ie: (==).  
	if(dwBitStart)
		dwItemBase &= ~dwBitStart;	//Remove all high order bits 

	for(ULONG i=0; i<cNameMap; i++)
	{
		//Does our item contains this particular bit?
		if(BIT_SET(dwItem, (DWORD)rgNameMap[i].lItem))
		{
			if(dwBitStart)
			{
				//If we are using a bitstart, then we need to make sure either this is one
				//of the special orable bits, or the items match exactly, if not then skip...
				if(! ((dwBitStart & rgNameMap[i].lItem) || dwItemBase == (DWORD)rgNameMap[i].lItem) )
					continue;
			}

			if(dwFound)
			{
				wcscat_s(wszBuffer, NUMELE(wszBuffer), L" | ");
				wcscat_s(wszBuffer, NUMELE(wszBuffer), rgNameMap[i].pwszName);
			}
			else
			{
				wcscpy_s(wszBuffer, NUMELE(wszBuffer), rgNameMap[i].pwszName);
			}
			
			//NOTE: We keep track of all the "bits" we have found.
			dwFound |= rgNameMap[i].lItem;
		}
	}

	//We keep track of all the bits we saw, so if at the end we didn't see some of the bits
	//then we just return the bits, and not an incorrect sub-set string mapping...
	if(dwFound != dwItem)
	{
		//Unknown, just display bitmask as hex
		StringFormat(wszBuffer, NUMELE(wszBuffer), L"0x%08x", dwItem);
	}

	//return
	return wszBuffer;
}


////////////////////////////////////////////////////////////////////////
// WCHAR* GetMapName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetMapName(REFGUID guid, ULONG cGuidMap, const WIDEGUIDMAP* rgGuidMap)
{
	for(ULONG i=0; i<cGuidMap; i++)	
	{
		if(guid == *(rgGuidMap[i].pGuid)) 
			return rgGuidMap[i].pwszName;
	}

	//Otherwise indicate failure
	return NULL;
}


////////////////////////////////////////////////////////////////////////
// WCHAR* GetMapName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetMapName(const DBID* pDBID, ULONG cMap, const WIDEDBIDMAP* rgMap)
{
	for(ULONG i=0; i<cMap; i++)	
	{
		if(memcmp(pDBID, rgMap[i].pDBID, sizeof(DBID))==0) 
			return rgMap[i].pwszName;
	}

	//Otherwise indicate failure
	return NULL;
}

////////////////////////////////////////////////////////////////////////
// CHAR* GetErrorName
//
////////////////////////////////////////////////////////////////////////
CHAR* GetErrorName(HRESULT hr)
{
	return GetMapName(hr, NUMELE(g_rgErrorMap), g_rgErrorMap);
}


////////////////////////////////////////////////////////////////////////
// WCHAR* GetInterfaceName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetInterfaceName(REFIID riid)
{
	return GetMapName(riid, NUMELE(g_rgInterfaceMaps), g_rgInterfaceMaps);
}


////////////////////////////////////////////////////////////////////////
//TODO: Remove once these are in our SQLOLEDB.H
extern const GUID  DBGUID_MSSQLXML          = {0x5d531cb2L,0xe6ed,0x11d2,{0xb2,0x52,0x00,0xc0,0x4f,0x68,0x1b,0x71}};
extern const GUID  DBGUID_XPATH             = {0xec2a4293L,0xe898,0x11d2,{0xb1,0xb7,0x00,0xc0,0x4f,0x68,0x0c,0x56}};

////////////////////////////////////////////////////////////////////////
// DialectMaps
//
////////////////////////////////////////////////////////////////////////
const static WIDEGUIDMAP g_rgDialectMaps[] =
{
	VALUE_PWCHAR(DBGUID_DEFAULT	),
	VALUE_PWCHAR(DBGUID_SQL	),
	VALUE_PWCHAR(MDGUID_MDX	),
	VALUE_PWCHAR(DBGUID_MSSQLXML	),
	VALUE_PWCHAR(DBGUID_XPATH	),

	//Negative testing
	VALUE_PWCHAR(GUID_NULL	),
};
const static ULONG g_cDialectMaps = NUMELE(g_rgDialectMaps);

////////////////////////////////////////////////////////////////////////
// WCHAR* GetDialectName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetDialectName(REFGUID rguid)
{
	return GetMapName(rguid, g_cDialectMaps, g_rgDialectMaps);
}



////////////////////////////////////////////////////////////////////////
// HRESULT DisplayBindingErrors
//
/////////////////////////////////////////////////////////////////////////////
HRESULT DisplayBindingErrors(HRESULT hrReturned, DBCOUNTITEM cBindings, const DBBINDING* rgBindings, void* pData)
{
	//Display the badstatus for pData operations.
	//(ie:  GetData / SetData / InsertRow)
	INT iSelect = 0;

	//Binding Errors only occur with the following returned codes...
	if(hrReturned!=DB_S_ERRORSOCCURRED && hrReturned!=DB_E_ERRORSOCCURRED)
		return hrReturned;

	for(ULONG i=0; i<cBindings; i++)
	{
		ASSERT(rgBindings);
		
		//If STATUS is not bound, we don't know if this binding failed or not.
		//And we can't really access the data or length, since we are not sure what the status is...
		if(!STATUS_IS_BOUND(rgBindings[i]))
			continue;
		
		DBSTATUS dbStatus = BINDING_STATUS(rgBindings[i], pData);
		DBLENGTH dbLength = LENGTH_IS_BOUND(rgBindings[i]) ? BINDING_LENGTH(rgBindings[i], pData) : 0;
		
		switch(dbStatus)
		{
			case DBSTATUS_S_OK:
			case DBSTATUS_S_ISNULL:
			case DBSTATUS_S_DEFAULT:
			case DBSTATUS_S_IGNORE:
				break;

			//Display Status Error to the user...
			default:
			{	
				iSelect = wMessageBox(GetFocus(), MB_TASKMODAL | MB_ICONERROR | MB_OKCANCEL, wsz_ERROR, 
					L"Binding Status Errors:\n"
					L"rgBindings[%lu]\n\n"
					L"iOrdinal = %Id\n"
					L"wType = %s\n"
					L"cbMaxLen = %Iu\n"
					L"bPrecision = %d\n"
					L"bScale = %d\n\n"
					L"DBSTATUS = %s\n"
					L"DBLENGTH = %lu\n",
					i,
					rgBindings[i].iOrdinal,
					GetDBTypeName(rgBindings[i].wType),
					rgBindings[i].cbMaxLen,
					rgBindings[i].bPrecision,
					rgBindings[i].bScale,
					GetStatusName(dbStatus),
					dbLength
					);

				if(iSelect == IDCANCEL)
				{
					hrReturned = DB_E_CANCELED;
					goto CLEANUP;
				}
				break;
			}
		}
	}

CLEANUP:
	return hrReturned;
}


////////////////////////////////////////////////////////////////////////
// HRESULT DisplayColAccessErrors
//
/////////////////////////////////////////////////////////////////////////////
HRESULT DisplayColAccessErrors(HRESULT hrReturned, DBORDINAL cColAccess, DBCOLUMNACCESS* rgColAccess)
{
	//Display the badstatus for pData operations.
	//(ie:  GetData / SetData / InsertRow)
	INT iSelect = 0;

	//Binding Errors only occur with the following returned codes...
	if(hrReturned!=DB_S_ERRORSOCCURRED && hrReturned!=DB_E_ERRORSOCCURRED)
		return hrReturned;

	for(ULONG i=0; i<cColAccess; i++)
	{
		ASSERT(rgColAccess);
		DBCOLUMNACCESS* pColAccess = &rgColAccess[i];

		switch(pColAccess->dwStatus)
		{
			case DBSTATUS_S_OK:
			case DBSTATUS_S_ISNULL:
			case DBSTATUS_S_DEFAULT:
			case DBSTATUS_S_IGNORE:
				break;

			default:
			{	
				//Convert the Column ID into a string
				WCHAR wszBuffer[MAX_NAME_LEN] = {0};
				DBIDToString(&pColAccess->columnid, wszBuffer, MAX_NAME_LEN);
				
				//Display Status Error to the user...
				iSelect = wMessageBox(GetFocus(), MB_TASKMODAL | MB_ICONERROR | MB_OKCANCEL, wsz_ERROR, 
					L"ColumnAccess Status Errors:\n"
					L"rgColAccess[%lu]\n\n"
					L"columnid = %s\n"
					L"wType = %s\n"
					L"cbMaxLen = %lu\n"
					L"bPrecision = %d\n"
					L"bScale = %d\n\n"
					L"dwStatus = %s\n"
					L"cbDataLen = %lu\n",
					i,
					wszBuffer,
					GetDBTypeName(pColAccess->wType),
					pColAccess->cbMaxLen,
					pColAccess->bPrecision,
					pColAccess->bScale,
					GetStatusName(pColAccess->dwStatus),
					pColAccess->cbDataLen
					);

				if(iSelect == IDCANCEL)
				{
					hrReturned = DB_E_CANCELED;
					goto CLEANUP;
				}
				break;
			}
		}
	}

CLEANUP:
	return hrReturned;
}


////////////////////////////////////////////////////////////////////////
// HRESULT DisplayColumnErrors
//
/////////////////////////////////////////////////////////////////////////////
HRESULT DisplayColumnErrors(HRESULT hrReturned, DBORDINAL cColumns, DBID* rgColumns, DBSTATUS* rgStatus)
{
	//Display the badstatus for pData operations.
	//(ie:  GetData / SetData / InsertRow)
	INT iSelect = 0;

	//Binding Errors only occur with the following returned codes...
	if(hrReturned!=DB_S_ERRORSOCCURRED && hrReturned!=DB_E_ERRORSOCCURRED)
		return hrReturned;

	for(ULONG i=0; i<cColumns; i++)
	{
		ASSERT(rgColumns);
		DBID* pDBID = &rgColumns[i];

		switch(rgStatus[i])
		{
			case DBSTATUS_S_OK:
			case DBSTATUS_S_ISNULL:
			case DBSTATUS_S_DEFAULT:
			case DBSTATUS_S_IGNORE:
				break;

			default:
			{	
				//Convert the Column ID into a string
				WCHAR wszBuffer[MAX_NAME_LEN] = {0};
				DBIDToString(pDBID, wszBuffer, MAX_NAME_LEN);
				
				//Display Status Error to the user...
				iSelect = wMessageBox(GetFocus(), MB_TASKMODAL | MB_ICONERROR | MB_OKCANCEL, wsz_ERROR, 
					L"Column Status Errors:\n"
					L"rgColumnIDs[%lu]\n\n"
					L"columnid = %s\n"
					L"dwStatus = %s\n",
					i,
					wszBuffer,
					GetStatusName(rgStatus[i])
					);

				if(iSelect == IDCANCEL)
				{
					hrReturned = DB_E_CANCELED;
					goto CLEANUP;
				}
				break;
			}
		}
	}

CLEANUP:
	return hrReturned;
}


////////////////////////////////////////////////////////////////////////
// STATUSMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgRowStatusMap[] =
{	
    VALUE_WCHAR(DBROWSTATUS_S_OK	),
	VALUE_WCHAR(DBROWSTATUS_S_MULTIPLECHANGES	),
	VALUE_WCHAR(DBROWSTATUS_S_PENDINGCHANGES	),
	VALUE_WCHAR(DBROWSTATUS_E_CANCELED	),
	VALUE_WCHAR(DBROWSTATUS_E_CANTRELEASE	),
	VALUE_WCHAR(DBROWSTATUS_E_CONCURRENCYVIOLATION	),
	VALUE_WCHAR(DBROWSTATUS_E_DELETED	),
	VALUE_WCHAR(DBROWSTATUS_E_PENDINGINSERT	),
	VALUE_WCHAR(DBROWSTATUS_E_NEWLYINSERTED	),
	VALUE_WCHAR(DBROWSTATUS_E_INTEGRITYVIOLATION	),
	VALUE_WCHAR(DBROWSTATUS_E_INVALID	),
	VALUE_WCHAR(DBROWSTATUS_E_MAXPENDCHANGESEXCEEDED	),
	VALUE_WCHAR(DBROWSTATUS_E_OBJECTOPEN	),
	VALUE_WCHAR(DBROWSTATUS_E_OUTOFMEMORY	),
	VALUE_WCHAR(DBROWSTATUS_E_PERMISSIONDENIED	),
	VALUE_WCHAR(DBROWSTATUS_E_LIMITREACHED	),
	VALUE_WCHAR(DBROWSTATUS_E_SCHEMAVIOLATION	),
	VALUE_WCHAR(DBROWSTATUS_E_FAIL	),

	//2.0
	VALUE_WCHAR(DBROWSTATUS_S_NOCHANGE	),
};



////////////////////////////////////////////////////////////////////////
// COLUMNFLAGSMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgColFlagsMaps[] =
{	
    VALUE_WCHAR(DBCOLUMNFLAGS_ISBOOKMARK),
	VALUE_WCHAR(DBCOLUMNFLAGS_MAYDEFER),
	VALUE_WCHAR(DBCOLUMNFLAGS_WRITE),
	VALUE_WCHAR(DBCOLUMNFLAGS_WRITEUNKNOWN),
	VALUE_WCHAR(DBCOLUMNFLAGS_ISFIXEDLENGTH),
	VALUE_WCHAR(DBCOLUMNFLAGS_ISNULLABLE),
	VALUE_WCHAR(DBCOLUMNFLAGS_MAYBENULL),
	VALUE_WCHAR(DBCOLUMNFLAGS_ISLONG),
	VALUE_WCHAR(DBCOLUMNFLAGS_ISROWID),
	VALUE_WCHAR(DBCOLUMNFLAGS_ISROWVER),
	VALUE_WCHAR(DBCOLUMNFLAGS_CACHEDEFERRED),

	//1.5
    VALUE_WCHAR(DBCOLUMNFLAGS_ISCHAPTER),

	//2.0
    VALUE_WCHAR(DBCOLUMNFLAGS_SCALEISNEGATIVE),

    //2.1
	VALUE_WCHAR(DBCOLUMNFLAGS_ISROWURL),
	VALUE_WCHAR(DBCOLUMNFLAGS_ISDEFAULTSTREAM),
	VALUE_WCHAR(DBCOLUMNFLAGS_ISCOLLECTION),

	//2.6
	VALUE_WCHAR(DBCOLUMNFLAGS_ISSTREAM),
	VALUE_WCHAR(DBCOLUMNFLAGS_ISROWSET),
	VALUE_WCHAR(DBCOLUMNFLAGS_ISROW),
	VALUE_WCHAR(DBCOLUMNFLAGS_ROWSPECIFICCOLUMN),
};
const static ULONG g_cColFlagsMaps = NUMELE(g_rgColFlagsMaps);



//////////////////////////////////////////////////////////////////////////////
// DBRESULTFLAG
//
//////////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgResultFlagMaps[] =
{
	VALUE_WCHAR(DBRESULTFLAG_DEFAULT),
	VALUE_WCHAR(DBRESULTFLAG_ROWSET),
	VALUE_WCHAR(DBRESULTFLAG_ROW),
};
const static ULONG g_cResultFlagMaps = NUMELE(g_rgResultFlagMaps);


	
//////////////////////////////////////////////////////////////////////////////
// GetPhaseName
//
//////////////////////////////////////////////////////////////////////////////
WCHAR* GetPhaseName(DBEVENTPHASE ePhase)
{
	const static WIDENAMEMAP	rgPhase[] =
	{
		VALUE_WCHAR(DBEVENTPHASE_OKTODO),
		VALUE_WCHAR(DBEVENTPHASE_ABOUTTODO),
		VALUE_WCHAR(DBEVENTPHASE_SYNCHAFTER),
		VALUE_WCHAR(DBEVENTPHASE_DIDEVENT),
		VALUE_WCHAR(DBEVENTPHASE_FAILEDTODO)
	};

	return GetMapName(ePhase, NUMELE(rgPhase), rgPhase);
}

//////////////////////////////////////////////////////////////////////////////
// GetReasonName
//
//////////////////////////////////////////////////////////////////////////////
WCHAR* GetReasonName(DBREASON eReason)
{
	const static WIDENAMEMAP	rgReason[] =
	{
		VALUE_WCHAR(	DBREASON_ROWSET_FETCHPOSITIONCHANGE	),
		VALUE_WCHAR(	DBREASON_ROWSET_RELEASE	),
		VALUE_WCHAR(	DBREASON_COLUMN_SET	),
		VALUE_WCHAR(	DBREASON_COLUMN_RECALCULATED	),
		VALUE_WCHAR(	DBREASON_ROW_ACTIVATE	),
		VALUE_WCHAR(	DBREASON_ROW_RELEASE	),
		VALUE_WCHAR(	DBREASON_ROW_DELETE	),
		VALUE_WCHAR(	DBREASON_ROW_FIRSTCHANGE	),
		VALUE_WCHAR(	DBREASON_ROW_INSERT	),
		VALUE_WCHAR(	DBREASON_ROW_RESYNCH	),
		VALUE_WCHAR(	DBREASON_ROW_UNDOCHANGE	),
		VALUE_WCHAR(	DBREASON_ROW_UNDOINSERT	),
		VALUE_WCHAR(	DBREASON_ROW_UNDODELETE	),
		VALUE_WCHAR(	DBREASON_ROW_UPDATE	),
		VALUE_WCHAR(	DBREASON_ROWSET_CHANGED	),
		
		VALUE_WCHAR( DBREASON_ROWPOSITION_CHANGED	),
		VALUE_WCHAR(	DBREASON_ROWPOSITION_CHAPTERCHANGED	),
		VALUE_WCHAR(	DBREASON_ROWPOSITION_CLEARED	),
		VALUE_WCHAR(	DBREASON_ROW_ASYNCHINSERT	),
			  		
//		VALUE_WCHAR(	DBREASON_ROWSET_ROWSADDED	),
//		VALUE_WCHAR(	DBREASON_ROWSET_POPULATIONCOMPLETE	),
//		VALUE_WCHAR(	DBREASON_ROWSET_POPULATIONSTOPPED	),
	};

	return GetMapName(eReason, NUMELE(rgReason), rgReason);
}


//////////////////////////////////////////////////////////////////////////////
// GetAsynchReason
//
//////////////////////////////////////////////////////////////////////////////
WCHAR* GetAsynchReason(ULONG ulOperation)
{
	const static WIDENAMEMAP	rgAsynchReason[] =
	{
		VALUE_WCHAR(	DBASYNCHOP_OPEN	),
	};

	return GetMapName(ulOperation, NUMELE(rgAsynchReason), rgAsynchReason);
}

//////////////////////////////////////////////////////////////////////////////
// GetAsynchPhase
//
//////////////////////////////////////////////////////////////////////////////
WCHAR* GetAsynchPhase(ULONG ulAsynchPhase)
{
	const static WIDENAMEMAP	rgAsynchPhase[] =
	{
		VALUE_WCHAR(DBASYNCHPHASE_INITIALIZATION),
		VALUE_WCHAR(DBASYNCHPHASE_POPULATION),
		VALUE_WCHAR(DBASYNCHPHASE_COMPLETE),
		VALUE_WCHAR(DBASYNCHPHASE_CANCELED),
	};

	return GetMapName(ulAsynchPhase, NUMELE(rgAsynchPhase), rgAsynchPhase);
}



////////////////////////////////////////////////////////////////////////
// HRESULT DisplayRowErrors
//
/////////////////////////////////////////////////////////////////////////////
HRESULT DisplayRowErrors(HRESULT hrReturned, DBROWCOUNT cRows, HROW* rghRows, DBROWSTATUS* rgRowStatus)
{
	//Display the badstatus for row operations.
	INT iSelect = 0;

	//Binding Errors only occur with the following returned codes...
	if(hrReturned!=DB_S_ERRORSOCCURRED && hrReturned!=DB_E_ERRORSOCCURRED)
		return hrReturned;

	for(LONG i=0; i<cRows; i++)
	{
		ASSERT(rghRows);
		ASSERT(rgRowStatus);
		
		switch(rgRowStatus[i])
		{
			case DBROWSTATUS_S_OK:
				break;

			//Display RowStatus Error to the user...
			default:
			{
				iSelect = wMessageBox(GetFocus(), MB_TASKMODAL | MB_ICONERROR | MB_OKCANCEL, wsz_ERROR, 
					L"Row Status Errors:\n\n"
					L"rghRow[%lu] = 0x%p\n"
					L"DBROWSTATUS = %d=%s",
					i,
					rghRows[i],
					rgRowStatus[i],
					GetMapName(rgRowStatus[i], NUMELE(g_rgRowStatusMap), g_rgRowStatusMap)
					);

				if(iSelect == IDCANCEL)
				{
					//NOTE: Will return DB_E_CANCELED if the user doesn't wish to continue
					hrReturned = DB_E_CANCELED;
					goto CLEANUP;
				}
				break;
			}
		}
	}

CLEANUP:
	return hrReturned;
}


////////////////////////////////////////////////////////////////////////
// STATUSMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP g_rgBindStatusMap[] =
{	
    VALUE_WCHAR(DBBINDSTATUS_OK	),
	VALUE_WCHAR(DBBINDSTATUS_BADORDINAL	),
	VALUE_WCHAR(DBBINDSTATUS_UNSUPPORTEDCONVERSION	),
	VALUE_WCHAR(DBBINDSTATUS_BADBINDINFO	),
	VALUE_WCHAR(DBBINDSTATUS_BADSTORAGEFLAGS	),
	VALUE_WCHAR(DBBINDSTATUS_NOINTERFACE	),
	VALUE_WCHAR(DBBINDSTATUS_MULTIPLESTORAGE	),
};


////////////////////////////////////////////////////////////////////////
// HRESULT DisplayAccessorErrors
//
/////////////////////////////////////////////////////////////////////////////
HRESULT DisplayAccessorErrors(HRESULT hrReturned, DBCOUNTITEM cBindings, const DBBINDING* rgBindings, DBBINDSTATUS* rgStatus)
{
	//Display the badstatus for row operations.
	INT iSelect = 0;

	//Binding Errors only occur with the following returned codes...
	if(hrReturned!=DB_S_ERRORSOCCURRED && hrReturned!=DB_E_ERRORSOCCURRED)
		return hrReturned;

	//Display any binding errors
	for(ULONG i=0; i<cBindings; i++)
	{
		ASSERT(rgBindings);
		ASSERT(rgStatus);
		
		switch(rgStatus[i])
		{
			case DBBINDSTATUS_OK:
				break;

			//Display BindStatus Error to the user...
			default:
			{
				iSelect = wMessageBox(GetFocus(), MB_TASKMODAL | MB_ICONERROR | MB_OKCANCEL, wsz_ERROR, 
					L"Accessor BindStatus Errors:\n"
					L"rgBindings[%lu]\n\n"
					L"iOrdinal = %ld\n"
					L"wType = %s\n"
					L"cbMaxLen = %lu\n"
					L"bPrecision = %d\n"
					L"bScale = %d\n\n"
					L"DBBINDSTATUS = %s",
					i,
					rgBindings[i].iOrdinal,
					GetDBTypeName(rgBindings[i].wType),
					rgBindings[i].cbMaxLen,
					rgBindings[i].bPrecision,
					rgBindings[i].bScale,
					GetMapName(rgStatus[i], NUMELE(g_rgBindStatusMap), g_rgBindStatusMap)
					);

				if(iSelect == IDCANCEL)
				{
					//NOTE: Will return DB_E_CANCELED if the user doesn't wish to continue
					hrReturned = DB_E_CANCELED;
					goto CLEANUP;
				}
				break;
			}	
		}
	}

CLEANUP:
	return hrReturned;
}


////////////////////////////////////////////////////////////////////////
// HRESULT DisplayPropErrors
//
/////////////////////////////////////////////////////////////////////////////
HRESULT DisplayPropErrors(HRESULT hrReturned, ULONG cPropSets, DBPROPSET* rgPropSets)
{
	//Property Errors only occur with the following returned codes...
	if(hrReturned!=DB_S_ERRORSOCCURRED && hrReturned!=DB_E_ERRORSOCCURRED)
		return hrReturned;

	//Display all property errors...
	for(ULONG iPropSet=0; iPropSet<cPropSets; iPropSet++)
	{
		DBPROPSET* pPropSet = &rgPropSets[iPropSet];
		for(ULONG iProp=0; iProp<pPropSet->cProperties; iProp++)
		{
			DBPROP* pProp = &pPropSet->rgProperties[iProp];
			if(pProp->dwStatus != DBPROPSTATUS_OK)
			{
				WCHAR wszBuffer[MAX_NAME_LEN+1];
				WCHAR wszPropSet[MAX_NAME_LEN+1];
				
				WCHAR* pwszPropSet = GetPropSetName(pPropSet->guidPropertySet);
				if(pwszPropSet == NULL)
				{	
					StringFromGUID2(pPropSet->guidPropertySet, wszPropSet, MAX_NAME_LEN);
					pwszPropSet = wszPropSet;
				}

				//Find property Value
				wszBuffer[0] = wEOL;
				VariantToString(&pProp->vValue, wszBuffer, MAX_NAME_LEN, CONV_VARBOOL);

				//Append the Error
				INT iSelect = wMessageBox
					(
						GetFocus(), MB_TASKMODAL | MB_ICONERROR | MB_OKCANCEL, wsz_ERROR, 
						L"Properties in Error:\n"
						L"rgPropSets[%d].rgProperties[%d]\n\n"
						L"guidPropertySet\t= %s\n"
						L"dwPropertyID\t= %s (0x%x)\n"
						L"dwOptions\t\t= %s\n"
						L"vValue.vt\t\t= %s\n"
						L"vValue\t\t= %s\n\n"
						L"dbStatus\t\t= %s",
						iPropSet,iProp,
						pwszPropSet,
						GetPropertyName(pProp->dwPropertyID, pPropSet->guidPropertySet),
						pProp->dwPropertyID, 
						pProp->dwOptions == DBPROPOPTIONS_REQUIRED ? L"DBPROPOPTIONS_REQUIRED" : L"DBPROPOPTIONS_OPTIONAL",
						GetVariantTypeName(V_VT(&pProp->vValue)),
						wszBuffer,
						GetPropStatusName(pProp->dwStatus)
					);

				if(iSelect == IDCANCEL)
				{
					//NOTE: Will return DB_E_CANCELED if the user doesn't wish to continue
					hrReturned = DB_E_CANCELED;
					goto CLEANUP;
				}
			}
		}
	}

CLEANUP:
	return hrReturned;
}


////////////////////////////////////////////////////////////////////////
// HRESULT DisplayPropErrors
//
/////////////////////////////////////////////////////////////////////////////
HRESULT DisplayPropErrors(HRESULT hrReturned, ULONG cPropInfoSets, DBPROPINFOSET* rgPropInfoSets)
{
	//Property Errors only occur with the following returned codes...
	if(hrReturned!=DB_S_ERRORSOCCURRED && hrReturned!=DB_E_ERRORSOCCURRED)
		return hrReturned;

	//Display all property errors...
	for(ULONG iPropInfoSet=0; iPropInfoSet<cPropInfoSets; iPropInfoSet++)
	{
		DBPROPINFOSET* pPropInfoSet = &rgPropInfoSets[iPropInfoSet];
		for(ULONG iPropInfo=0; iPropInfo<pPropInfoSet->cPropertyInfos; iPropInfo++)
		{
			DBPROPINFO* pPropInfo = &pPropInfoSet->rgPropertyInfos[iPropInfo];
			if(pPropInfo->dwFlags == DBPROPFLAGS_NOTSUPPORTED)
			{
				WCHAR wszBuffer[MAX_NAME_LEN+1];
				WCHAR wszPropSet[MAX_NAME_LEN+1];
				
				WCHAR* pwszPropSet = GetPropSetName(pPropInfoSet->guidPropertySet);
				if(pwszPropSet == NULL)
				{	
					StringFromGUID2(pPropInfoSet->guidPropertySet, wszPropSet, MAX_NAME_LEN);
					pwszPropSet = wszPropSet;
				}

				//Find property Value
				wszBuffer[0] = wEOL;
				VariantToString(&pPropInfo->vValues, wszBuffer, MAX_NAME_LEN, CONV_VARBOOL);

				//Append the Error
				INT iSelect = wMessageBox
					(
						GetFocus(), MB_TASKMODAL | MB_ICONERROR | MB_OKCANCEL, wsz_ERROR, 
						L"Properties in Error:\n"
						L"rgPropInfoSets[%d].rgPropertyInfos[%d]\n\n"
						L"guidPropertySet\t= %s\n"
						L"pwszDescription\t= %s\n"
						L"dwPropertyID\t= %s (0x%x)\n"
						L"vtType\t\t= %s\n"
						L"vValues\t\t= %s\n\n"
						L"dwFlags\t\t= %s (0x%x)",
						iPropInfoSet,iPropInfo,
						pwszPropSet,
						pPropInfo->pwszDescription, 
						GetPropertyName(pPropInfo->dwPropertyID, pPropInfoSet->guidPropertySet),
						pPropInfo->dwPropertyID, 
						GetVariantTypeName(pPropInfo->vtType),
						wszBuffer,
						L"DBPROPFLAGS_NOTSUPPORTED",
						pPropInfo->dwFlags
					);

				if(iSelect == IDCANCEL)
				{
					//NOTE: Will return DB_E_CANCELED if the user doesn't wish to continue
					hrReturned = DB_E_CANCELED;
					goto CLEANUP;
				}
			}
		}
	}

CLEANUP:
	return hrReturned;
}


////////////////////////////////////////////////////////////////////////
// HRESULT DisplayPropErrors
//
/////////////////////////////////////////////////////////////////////////////
HRESULT DisplayPropErrors(HRESULT hrReturned, REFIID riid, IUnknown* pIUnknown)
{
	ASSERT(pIUnknown);

	//Property Errors only occur with the following returned codes...
	if(hrReturned!=DB_S_ERRORSOCCURRED && hrReturned!=DB_E_ERRORSOCCURRED)
		return hrReturned;

	//GetProperties with DBPROPSET_PROPERTIESINERROR.
	ULONG cPropSets = 0;
	DBPROPSET* rgPropSets = NULL;
	IDBProperties* pIDBProperties = NULL;
	ICommandProperties* pICommandProperties = NULL;

	//Setup input DBPROPSET_PROPERTIESINERROR
	const ULONG cPropertyIDSets = 1;
	DBPROPIDSET rgPropertyIDSets[cPropertyIDSets];
	rgPropertyIDSets[0].guidPropertySet = DBPROPSET_PROPERTIESINERROR;
	rgPropertyIDSets[0].cPropertyIDs = 0;
	rgPropertyIDSets[0].rgPropertyIDs = NULL;

	//Which GetProperties
	if(riid == IID_IDBProperties)
	{
		XTESTC(pIUnknown->QueryInterface(IID_IDBProperties, (void**)&pIDBProperties));
		XTESTC(pIDBProperties->GetProperties(cPropertyIDSets, rgPropertyIDSets, &cPropSets, &rgPropSets));
	}
	else
	{	
		XTESTC(pIUnknown->QueryInterface(IID_ICommandProperties, (void**)&pICommandProperties));
		XTESTC(pICommandProperties->GetProperties(cPropertyIDSets, rgPropertyIDSets, &cPropSets, &rgPropSets));
	}

	//Now delegate to display all properties in error
	TESTC(hrReturned = DisplayPropErrors(hrReturned, cPropSets, rgPropSets));

CLEANUP:
	FreeProperties(&cPropSets, &rgPropSets);
	SAFE_RELEASE(pICommandProperties);
	SAFE_RELEASE(pIDBProperties);
	return hrReturned;
}


////////////////////////////////////////////////////////////////////////
// HRESULT DisplayRefCountErrors
//
/////////////////////////////////////////////////////////////////////////////
HRESULT DisplayRefCountErrors(WCHAR* pwszName, ULONG ulActRefCount, ULONG ulExpRefCount)
{
	ASSERT(pwszName);

	//Display RefCount difference...
	if(ulActRefCount != ulExpRefCount && GetErrorPosting(EP_REFCOUNT_FAILURE))
	{
		wMessageBox
			(
			GetFocus(), 
			MB_TASKMODAL | MB_ICONERROR | MB_OK, 
			wsz_ERROR, 
			L"%s\n"
			L"RefCount = %d, Expected = %d",
			pwszName,
			ulActRefCount,
			ulExpRefCount
			);
	}
		
	return S_OK;
}


////////////////////////////////////////////////////////////////////////
// HRESULT DisplayAllErrors
//
/////////////////////////////////////////////////////////////////////////////
HRESULT DisplayAllErrors(HRESULT hrActual, WCHAR* pwszFile, ULONG ulLine, INT* piResult)
{
	//Delegate
	//This function just verifies that the hreuslt succeeded...
	return DisplayAllErrors(hrActual, SUCCEEDED(hrActual) ? hrActual : S_OK, pwszFile, ulLine, piResult);
}

////////////////////////////////////////////////////////////////////////
// HRESULT DisplayAllErrors
//
/////////////////////////////////////////////////////////////////////////////
HRESULT DisplayAllErrors(HRESULT hrActual, HRESULT hrExpected, WCHAR* pwszFile, ULONG ulLine, INT* piResult)
{
	BOOL bEqual = (hrActual == hrExpected) || (hrActual == S_OK);
	
	//First Display any ErrorInfo
	//NOTE: If ErrorInfo=Always, ErrorInfo is always displayed
	if((!bEqual || GetErrorPosting(EP_ERRORINFO_ALWAYS)) && !GetErrorPosting(EP_ERRORINFO_NEVER))
	{
		if(DisplayErrorInfo(hrActual, pwszFile, ulLine, piResult)==S_OK)
		{
			//We had ErrorInfo, no need to display error info
			//Unless the user has something other than NOERRORINFO selected
			if(GetErrorPosting(EP_HRESULT_NOERRORINFO))
				goto CLEANUP;
		}
	}
	
	//Second, Display the HRESULT, (if requested)
	//NOTE: If HRESULT=Always, Hresult is always displayed, except if S_OK is returned, otherwise you would always get message boxes...
	if((!bEqual || (hrActual!=S_OK && GetErrorPosting(EP_HRESULT_ALWAYS))) && !GetErrorPosting(EP_HRESULT_NEVER))
	{
		//Display the HRESULT
		DisplayHRESULT(hrActual, pwszFile, ulLine, piResult);
	}

CLEANUP:
	//We need to return a failure code if not equal, so we don't continue...
	if(!bEqual && SUCCEEDED(hrActual))
		return E_FAIL;
	
	return hrActual;
}


//////////////////////////////////////////////////////////////////
// DisplayWinError
//
//////////////////////////////////////////////////////////////////
HRESULT	DisplayWinError(DWORD dwError, WCHAR* pwszFile, LONG lLine, WCHAR* pwszText)
{
	if(dwError)
	{
		CHAR* pszError = NULL;

		//Format the Message (obtain the textual string)
		FormatMessageA( 
			FORMAT_MESSAGE_ALLOCATE_BUFFER | 
			FORMAT_MESSAGE_FROM_SYSTEM | 
			FORMAT_MESSAGE_IGNORE_INSERTS,
			NULL,
			dwError,
			MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
			(CHAR*)&pszError,
			0,
			NULL 
		);

		if(pszError)
		{
			//Display the Error
			wMessageBox
				(
				GetFocus(), MB_TASKMODAL | MB_ICONERROR | MB_OK, wsz_ERROR, 
				L"%s: GetLastError() = %d = %S" wWndEOL
				L"<File:%s>" wWndEOL
				L"Line:%d" wWndEOL, 
				pwszText, 
				dwError, 
				pszError, 
				pwszFile, 
				lLine
				);

			// Free the buffer.
			LocalFree( pszError );
		}
	}

	return dwError;
}


////////////////////////////////////////////////////////////////////////
// HRESULT DisplayHRESULT
//
/////////////////////////////////////////////////////////////////////////////
HRESULT DisplayHRESULT(HRESULT hrActual, WCHAR* pwszFile, ULONG ulLine, INT* piResult)
{
	//If we end up here, their must not be any extended error info supported by the provider
	//the best we can do is display the HRESULT, and see of the system has a defined string
	//for the last error?
	CHAR* pszError = NULL;
	INT iResult = 0;

	//Format the Message (obtain the textual string)
	FormatMessageA( 
		FORMAT_MESSAGE_ALLOCATE_BUFFER | 
		FORMAT_MESSAGE_FROM_SYSTEM | 
		FORMAT_MESSAGE_IGNORE_INSERTS,
		NULL,
		hrActual,
		MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
		(CHAR*)&pszError,
		0,
		NULL );

	if(pszError)
	{
		//Display the Error (including Windows Defined String)
		iResult = wMessageBox(GetFocus(), MB_TASKMODAL | MB_ICONERROR | MB_OK, wsz_ERROR, 
			L"Interface: %s\nResult: 0x%08x = %S\n\nFormatMessage: \"%S\"\n\nFile: %s\nLine: %d", L"Unknown", hrActual, GetErrorName(hrActual), pszError, pwszFile, ulLine);

		// Free the buffer from Format Message
		LocalFree( pszError );
	}
	else
	{
		//Display the Error
		iResult = wMessageBox(GetFocus(), MB_TASKMODAL | MB_ICONERROR | MB_OK, wsz_ERROR, 
			L"Interface: %s\nResult: 0x%08x = %S\n\nFile: %s\nLine: %d", L"Unknown", hrActual, GetErrorName(hrActual), pwszFile, ulLine);
	}

	if(piResult)
		*piResult = iResult;

	return hrActual;
}



////////////////////////////////////////////////////////////////////////
// HRESULT DisplayErrorInfo
//
/////////////////////////////////////////////////////////////////////////////
HRESULT DisplayErrorInfo(HRESULT hrActual, WCHAR* pwszFile, ULONG ulLine, INT* piResult)
{
	HRESULT hr = S_OK;

	CSmartPtr<IErrorInfo>		spErrorInfo;
	CSmartPtr<IErrorRecords>	spErrorRecords;
	ULONG cErrorRecords = 0;
	
	CComBSTR cstrDescription;
	CComBSTR cstrSource;
	CComBSTR cstrSQLInfo;
	INT iResult = 0;
	static LCID lcid = GetSystemDefaultLCID(); 

	//NOTE: GetErrorInfo will return S_OK and a NULL pointer if there is not error object 
	if((hr = GetErrorInfo(0, &spErrorInfo))==S_OK && spErrorInfo)
	{
		//The Error Object may support multiple Errors (IErrorRecords)
		if(SUCCEEDED(hr = spErrorInfo->QueryInterface(&spErrorRecords)))
		{
			//Multiple Errors
			XTESTC(hr = spErrorRecords->GetRecordCount(&cErrorRecords));
		}
		else
		{
			//Only a single Error Object
			cErrorRecords = 1;
		}

		LONG lNativeError = 0;
		ERRORINFO ErrorInfo = { hrActual, 0 };

		//Loop through the records
		for(ULONG i=0; i<cErrorRecords; i++)
		{
			//For multiple errors, we will allow the user to cancel out of the dialogs
			//since the user may not be interested in clicking through many errors...
			//NOTE: This logic puts on the CANCEL button if more than 1 and not the last error...
			UINT uMBType = MB_TASKMODAL | MB_ICONERROR | MB_OK;
			if(i < (cErrorRecords-1)) 
				uMBType |= MB_OKCANCEL;

			//ErrorRecords
			if(spErrorRecords)
			{
				spErrorInfo.Release();
				XTESTC(hr = spErrorRecords->GetErrorInfo(i, lcid, &spErrorInfo));

				//Get the Basic ErrorInfo
				XTEST(hr = spErrorRecords->GetBasicErrorInfo(i, &ErrorInfo));

				//Get the SQL Info
				GetSqlErrorInfo(i, spErrorRecords, &cstrSQLInfo, &lNativeError);
			}
			else
			{
				//ErrorInfo is only available...
				XTEST(hr = spErrorInfo->GetGUID(&ErrorInfo.iid));
			}

			//Get the Description
			XTEST(hr = spErrorInfo->GetDescription(&cstrDescription));
				
			//Get the Source - this will be the window title...
			XTEST(hr = spErrorInfo->GetSource(&cstrSource));
			
			//Display the Error
			if(cstrSQLInfo)
			{
				iResult = wMessageBox(GetFocus(), uMBType, cstrSource ? cstrSource : wsz_ERRORINFO, 
								L"Source: \"%s\"\n\n"
								L"Interface: %s\n"
								L"Result: 0x%08x = %S\n\n"
								L"ISQLErrorInfo: [%s][0x%08x]\n"
								L"IErrorInfo: [0x%08x] \"%s\"\n\n"
								L"File: %s\n"
								L"Line: %d", 
								cstrSource, 
								GetInterfaceName(ErrorInfo.iid), 
								ErrorInfo.hrError, GetErrorName(ErrorInfo.hrError), 
								cstrSQLInfo, lNativeError, 
								ErrorInfo.dwMinor, cstrDescription, 
								pwszFile, 
								ulLine);
			}
			else
			{
				iResult = wMessageBox(GetFocus(), uMBType, cstrSource ? cstrSource : wsz_ERRORINFO, 
								L"Source: \"%s\"\n\n"
								L"Interface: %s\n"
								L"Result: 0x%08x = %S\n\n"
//								L"ISQLErrorInfo: [%s][0x%08x]\n"
								L"IErrorInfo: [0x%08x] \"%s\"\n\n"
								L"File: %s\n"
								L"Line: %d", 
								cstrSource, 
								GetInterfaceName(ErrorInfo.iid), 
								ErrorInfo.hrError, GetErrorName(ErrorInfo.hrError), 
//								cstrSQLInfo, lNativeError, 
								ErrorInfo.dwMinor, cstrDescription, 
								pwszFile, 
								ulLine);
			}

			spErrorInfo.Release();
			cstrDescription.Empty();
			cstrSource.Empty();
			cstrSQLInfo.Empty();

			if(iResult == IDCANCEL)
				goto CLEANUP;
		}
	}
	

CLEANUP:
	if(piResult)
		*piResult = iResult;
	return hr;
}



////////////////////////////////////////////////////////////////////////
// HRESULT GetSqlErrorInfo
//
// Get the error message generated by an OLE DB object
/////////////////////////////////////////////////////////////////////////////
HRESULT GetSqlErrorInfo(ULONG iRecord, IErrorRecords* pIErrorRecords, BSTR* pBstr, LONG* plNativeError)
{
	ASSERT(pBstr);
	HRESULT hr = S_OK;

	CSmartPtr<ISQLErrorInfo>	spSQLErrorInfo;
	LONG lNativeError = 0;

	//Get the Error Records
	if(pIErrorRecords)
	{
		//If there is ErrorInfo, GetSQLInfo for the desired record
		//ISQLErrorInfo is not mandatory
		TESTC(hr = pIErrorRecords->GetCustomErrorObject(iRecord, IID_ISQLErrorInfo, (IUnknown**)&spSQLErrorInfo));
		
		//If there was a CustomErrorObject
		if(spSQLErrorInfo)
			hr = spSQLErrorInfo->GetSQLInfo(pBstr, &lNativeError);
	}

CLEANUP:
	if(plNativeError)
		*plNativeError = lNativeError;
	return hr;
}


